relevance

How to use an ngram and edge ngram tokenizer together in elasticsearch index?

大兔子大兔子 提交于 2021-02-11 14:21:38
问题 I have an index containing 3 documents. { "firstname": "Anne", "lastname": "Borg", } { "firstname": "Leanne", "lastname": "Ray" }, { "firstname": "Anne", "middlename": "M", "lastname": "Stone" } When I search for "Anne", I would like elastic to return all 3 of these documents (because they all match the term "Anne" to a degree). BUT, I would like Leanne Ray to have a lower score (relevance ranking) because the search term "Anne" appears at a later position in this document than the term

Assign a higher score to matches containing the search query at an earlier position in elasticsearch

烈酒焚心 提交于 2020-05-17 07:46:07
问题 This question is similar to my other question enter link description here which Val answered. I have an index containing 3 documents. { "firstname": "Anne", "lastname": "Borg", } { "firstname": "Leanne", "lastname": "Ray" }, { "firstname": "Anne", "middlename": "M", "lastname": "Stone" } When I search for "Ann", I would like elastic to return all 3 of these documents (because they all match the term "Ann" to a degree). BUT, I would like Leanne Ray to have a lower score (relevance ranking)

Getting EXACT matches from full-text search returned first?

廉价感情. 提交于 2020-01-17 02:53:28
问题 I am using the below code for example: SELECT *, (MATCH (`wm`, `locn`, `gns`) AGAINST('foot locker')) AS score FROM `example_table` WHERE MATCH (`wm`, `locn`, `gns`) AGAINST('foot locker')) order by score DESC; However even though EXACT matches exist in the wm column, the EXACT match doesn't appear untiil the 8th result. The ones ahead of it all have the phrase too, but also some following text. I checked the locn , gns fields to see how they compared and nothing really stands out that should

Relevancy boosting very slow in Solr

最后都变了- 提交于 2020-01-05 09:34:06
问题 I have a Solr index with about 2.5M items in it and I am trying to use an ExternalFileField to boost relevancy. Unfortunately, it's VERY slow when I try to do this, despite it being a beefy machine and Solr having lots of memory available. In the external file I have contents like: 747501=3.8294805903e-07 747500=3.8294805903e-07 1718770=4.03292174724e-07 1534562=3.8294805903e-07 1956010=3.8294805903e-07 747509=3.8294805903e-07 747508=3.8294805903e-07 1718772=3.8294805903e-07 1391385=3

select relevance title based on tag similar to like with mysql

China☆狼群 提交于 2020-01-02 09:52:52
问题 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

Getting Solr Elevated Results on top of Sorted by field Results

拈花ヽ惹草 提交于 2019-12-24 06:58:30
问题 We are using Solr 5. We are able to apply sorting on display order field in to Solr query and it works fine. We have certain results which are elevated and will always want them first. If we remove the sorting, the elevation works fine. However, we are unable to get both of them work together. We want to first list elevated results in the top and then other results based on the display order field. However, we are unable to find how to do this. Any help will be appreciated. Thanks in advance.

Return only results that match enough NGrams with Solr

不问归期 提交于 2019-12-24 01:25:12
问题 To achieve some degree of fault tolerance with Solr I have started to use the NGramFilterFactory . Here are the intersting bits from the schema.xml : <field name="text" type="text" indexed="true" stored="true"/> <copyField source="text" dest="text_ngram" /> <field name="text_ngram" type="text_ngram" indexed="true" stored="false"/> <fieldType name="text_ngram" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.KeywordTokenizerFactory" /> <filter class="solr

Elastic Search. _Score is null in aggregations. Why?

老子叫甜甜 提交于 2019-12-24 00:53:06
问题 I use ES v 1.7. ES returns _score just only in "hits" section, but i'm not interested in "hits", I need data from "aggregations" section of responce with _score . Why ES do like that and How to fix it? Requset: { "size": 1, "query": { "bool": { "must": [ { "match": {"_all": {"query": "test","operator": "and","fuzziness": "2"}}} ], "should": [ { "multi_match" : { "query": "test" ,"type": "best_fields" ,"fields": ["ObjectData.PRTNAME","ObjectData.EXTERNALID","ObjectData.contactList.VALUE","