I am building a system that uses Elasticsearch to store and retrieve
library catalogue data. One thing I've been asked for is a browse interface.
Here's a definition of what this is:
- The user does a search, for example "Author starts with" and they
supply "Smith" - The system puts them into the middle of a list of authors, at or near
the position of the first one that starts with "Smith", so they might see:- Smart, Murray
- Smart, Murray J.
- Smeaton, Duncan
- Smieliauskas, Wally
- Smillie, John
- Smith Milway, Katie
- Smith, A. M. C.
- Smith, Andrew
- Smith, Andrew M. C.
- etc.
- These will be paged, so having ~20 or so results per page. If the user
pages back, they head towards the start of the alphabet, if they page
forwards they will go onward. - Each result shown will have a count beside it showing how many results
(i.e. catalogue items) are associated with that author. - Clicking on a result takes you to everything by that author (this and
everything beyond it is fairly easy and mostly implemented already.)
I'm wondering if anyone has any good ideas on how to approach this. At this
stage, I don't care too much about handling searches that aren't "field
starts with" searches, as exactly how that will be done is currently up in
the air and I'll deal with it when the time comes.
Here's what I'm thinking, but there are issues with it:
- All the fields that are going to be browsed are faceted
- I get a list of all the facets for that field, search through it to
find the starting point, and handle the paging manually in code.- This has the big problem that I might be fetching hundreds of
thousands of terms and processing them, which won't be quick.
- This has the big problem that I might be fetching hundreds of
I'm open to any options here, whether I can somehow jump into the middle of
a large set of facets like the query "from" field, or if I should instead
put everything into another index specifically for this purpose (though I
don't know how I'd structure and query it), or something else.
From what I can see, my ideal solution would be that I can specify the
facet field, tell ES that I want to start at the one that starts with
"Smith", and it displays from around there, then I have the ability to say
"go 20 back", but I'm not sure that this is possible.
You can see an example of the sort of thing I'm talking about in action
here: http://hollisclassic.harvard.edu/ - put in Smith as "Author (last
name first)", and it gives you a (terribly ugly looking) browse list.
Any thoughts?
Thanks, Robin.
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/606138e0-0989-4106-9073-c3fdc4b0b46e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.