I'm learning elastic search,
I wanted to ask if there is any way to get most searched results first,
like:
by altering the documents and updating a value of em with scores,
using some kind of formula or something else
thanks community :)
You don't have that out of the box but you can indeed modify a document and increase the number of views when a user clicks on a result then use that field as part of the score (function_score might help for this).
Related
Maybe a dummy question: is it possible to have multiple score fields?
I use a custom score based on function_score query. This score is being displayed to the user to show, how much each document matches his/her preferences. So far so good.
But! The user should be able to filter the documents and (of course) sort them not only by the custom relevance (how much each document matches his/her preferences) but also by the common relevance - how much each document matches the filter criteria.
So my first idea was to place the score calculated by function_score query to a custom field but it does not seems to be supported.
Or am I completely wrong and I should use another approach?
I took a different approach - in case user applies some filter the I run the query without function_score percolation and use the score calculated by ES and sort by it. Then I take all IDs from the result page and run percolation query with these IDs to get the custom "matching score". It does not seems to cause noticeable slowdown.
Anyway, I welcome any feedback.
How can I boost documents that are similar to the current top ones according to a specific field, at query time?
When someone does a search, I provide an acceptably ordered set of results, but I'd like to boost the results that share a field with the current top results.
Say I search for "Titanic" in a movie index.
I'd like movies that share DiCaprio in the "actors" field to be boosted as well, despite not having anything to do with the word "titanic"
Thank you!
First of all, sorry for my bad English.
I'm very new to Elastic Search, and I want to filter query results by its scores.
What I'm trying to achieve is to remove results that are not intended to seek.
For example, let's say I have documents that storing field value for each document 'Comme des Garcons' and 'XXX des YYY'. And then when I search for 'Comme des', both resulted in. I want to exclude 'XXX des YYY' for this case because it's certain that a user does intend to seek 'Comme des Garcons'
I had tried to use a query that return items whole tokens are match, but I have to think about other cases like when people search for 'des'. In this case both have to appear in result because it is not certain which one is intended to seek.
So I thought how I can solve this and got an idea myself, and it was filtering results which have some amount of gap from its highest score.
But I don't know how to implement this to my query and it is a right way.
So my question is
Is my idea bad?
If not so bad, how to implement my idea to query?
Thank you for reading.
there are usecases where I really would like to know which term was matched in which field by my search. With this information I would like to disclose the information which field caused the hit to the user on my webpage. I also would like to know the term playing part in the hit. In my case it is a database identifier, so I would take the matched term - an ID - get the respective database record and display useful information to the user.
I currently know two ways: Highlighting and the explain API. However, the first requires stored values which seems unnecessary. The second is meant for debugging only and is rather expensive so I wouldn't want it to run with every query.
I don't know another way which is confusing: The highlighting algorithms need the information I want to use anyway, can't I just get it somehow?
On a related note, I would also be interested in the opposite case: Which term did not hit at all? This information would allow for features like "terms that didn't match your query" like Google does sometimes (where the respective words are shown in grey-strikeout).
Thanks for hints!
I need to facet inside n documents which are selected like
... ORDER BY something DESC LIMIT 100
Is that possible with Solr? How?
this is a total hack, but here goes...
do your initial query, and get your results back.
construct a new query, like so:
http://localhost:8080/solr/select/?q=id%3A123+OR+id%3A456...(keep OR-ing them up)...&facet=true&facet.field=something
where you concatenate all of your ids to a new query using OR. then, when you facet on your field, the facet summary will only apply to the results.
AFAIK no, that's not supported / implemented. Facets aren't really meant to be "stats" but a guidance to the end-user. Picture yourself browsing a faceted interface and seeing facets change whenever you change sort order or paging. Faceted browsing would be useless if it worked like that.
I think this would be a nice feature for the StatsComponent though.
I think this is possible with results grouping (now in trunk!):
http://wiki.apache.org/solr/FieldCollapsing
... the only problem is that you can set only one 'facet.field' (i.e. group.field)
But the great thing is that you get scored facets!