I have an Elasticsearch setup, where I would like to add per-user ordering,
i.e. every user gets different search results depending on how they've
interacted with the documents. We have a score-table in MySQL with a row
per document per user, and we would like to sort search results based on
the specific user's scores.
We've investigated adding a field per user to each document with the name
"score{user_id}", e.g. "_score_5327" for the user with id 5327. Quering
elasticsearch on behalf of that user, then requires specifying "sort": {
"_score_5327": { "order": "desc", ignore_unmapped: true } }. By keeping the
per-user score on the root document, we sidestep the problem of not being
able to sort on nested document fields. We can keep the scores up-to-date
with the partial update API (
http://www.elasticsearch.org/guide/reference/api/update.html).
The approach works well in development, but when we re-build our index in
staging with a lot more data, ES falls over after a lot of long GC pauses
and then a java.lang.OutOfMemoryError: Java heap space. Does the extra
fields cause ES to fail? Can ES not handle the many extra fields (~3,000
scores for the most popular document)? What are alternative solutions?
Thanks,
Andreas
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.