relevance

Lucene.Net: Relevancy by distance between words

浪子不回头ぞ 提交于 2019-12-11 17:15:55
问题 I create (and update frequently) the index of users using following code (a bit shortened for demonstration purposes here): Lucene.Net.Store.Directory directory = FSDirectory.Open(new System.IO.DirectoryInfo("TestLuceneIndex")); StandardAnalyzer standardAnalyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29); IndexWriter indexWriter = new IndexWriter(directory, standardAnalyzer, IndexWriter.MaxFieldLength.UNLIMITED); Document doc = new Document(); doc.Add(new Field("UID", uid,

Elasticsearch - similary for countries

限于喜欢 提交于 2019-12-11 06:59:35
问题 I have a document, which contains many fields, one of them is country . There are many documents with the same country . When I do match query , or fuzzy search against country , and query for Belgium for example, it returns list of documents, which matched Belgium country, but they all have different score. I believe it's because of tdidf similarity and presence of belgium term in other fields of documents, etc. I'd like it return the same score in this case. What similarity should I use?

Relevance by type on same field in elasticsearch

心不动则不痛 提交于 2019-12-11 06:43:57
问题 Is there any way to boost search results on same field depending on type? My basic boosting is something like: GET _search { "query": { "simple_query_string": { "query": "mangan", "fields":["_all", "title^6"] } } } But for some other documents I want title to be less important, so I tried to prefix it with type: GET _search { "query": { "simple_query_string": { "query": "mangan", "fields":[ "_all", "DocumentationPage.title^6", "DocumentationPage.title^6"] } } } But then it does not boost at

How can you compare sets of numbers and get the most relevant results using MySQL and PHP?

蹲街弑〆低调 提交于 2019-12-11 01:47:40
问题 Consider this: set A: 1 2 3 4 set B: 3 4 5 6 set C: 4 5 6 7 set D: 1 I want to compare D with the rest and get as a result a set of numbers as most relevant. The result should be in this order: 4 (as D has a common number with A and 4 is in A and also in B and C), 3 (as D has a common number with A and 3 is in A and B), 2 (as D has a common number with A and 2 is also in A), then 5, 6, 7. Is there some algorithm to do this in an efficient way in PHP/MySQL? I don't want to reinvent the wheel,

Sorting By Relevancy in MongoDB without Exceeding the Memory Buffer

半城伤御伤魂 提交于 2019-12-10 10:56:26
问题 I'm playing with the recent support for full text search in MongoDB but finding it's limitations so severe it's not very usable. Perhaps I am misunderstanding how it works and someone could enlighten me. I want to display this most relevant results first so this means my query needs to look like: db.properties.find({$text: {$search: "My Search"}}, {score: { $meta: "textScore" }}).sort({score: {$meta: "textScore"}}) But I find unless my search is VERY specific I quickly get: Executor error:

relevance search across multiple related tables

馋奶兔 提交于 2019-12-08 14:07:27
问题 I have a table called cards which has related tables brigades and identifiers . A single card can have multiple brigades and identifiers. I want to take a singe search such as 'purple king' where 'purple' is a brigade and 'king' is an identifier, and find cards with those brigades and identifiers. This answer to a similar question, https://stackoverflow.com/a/9951200/633513, showed how you can fulltext search across multiple tables. I'd like to do the same thing, except i just want related

php - display links to related content

◇◆丶佛笑我妖孽 提交于 2019-12-08 10:40:10
问题 I am looking to implement a 'youtube related videos' style related content system. I have 5 tags/keywords for each of my pages, a title and a description. I would like to display links to the two most similar pages. I am guessing a mysql query based around order by relevance. many thanks. 回答1: you can break up the title, description, keywords into tokens and then do a full text search in mysql on those keywords and order by relevance. select * from article where match(title, description,

Is there an algorithm for determining the relevance of a text to a theme?

浪尽此生 提交于 2019-12-08 03:11:50
问题 I want to know what can be used to determine the relevance of a page for a theme like games, movies, etc. Is there some research in this area or is there only counting how many times some relevant words appear? 回答1: The common choice is supervised document classification on bag of words (or bag of n-grams) features, preferably with tf-idf weighting. Popular algorithms include Naive Bayes and (linear) SVMs. For this approach, you'll need labeled training data, i.e. documents annotated with

Is there an algorithm for determining the relevance of a text to a theme?

一曲冷凌霜 提交于 2019-12-06 15:02:30
I want to know what can be used to determine the relevance of a page for a theme like games, movies, etc. Is there some research in this area or is there only counting how many times some relevant words appear? The common choice is supervised document classification on bag of words (or bag of n-grams) features, preferably with tf-idf weighting. Popular algorithms include Naive Bayes and (linear) SVMs. For this approach, you'll need labeled training data, i.e. documents annotated with relevant themes. See, e.g., Introduction to Information Retrieval , chapters 13-15. 来源: https://stackoverflow

select relevance title based on tag similar to like with mysql

二次信任 提交于 2019-12-06 13:33:30
TAGS tag_id post_id value ------------------------ 1 1 some 2 1 good 3 1 title 4 2 some 5 2 good 6 3 some 7 4 good 8 4 title POSTS post_id title ------------------- 1 some good title 2 some good 3 some 4 good title how can we get the post_id = 1 and 2 that contains value some and good in the same post_id? so the result is RESULT title ---------- some good title some good good title dosent show becouse there is no some value in post_id = 4 in tags. some doesnt show beouse the requirement good hims056 Try LIKE multiple time: SELECT * FROM post WHERE title LIKE '%some%' AND title LIKE '%good%'