Hello
I am building a search project for products with following requirement:
get results by a keyword
then can filter results by some options in the web page.
filter options , for example filter by categories, by brands. For each category and each brand have product quantity displayed in web page. Something like Electronic(10). Electronic is the category name. 10 is the results quantity that is pre-retrieved.
I want to ask which kinds of queries to use with elasticsearch for better performace.
this can be very helpful for me. I am new on elasticsearch.
1st multiMatchQuery with analyzed on related fields.
2nd step using termsQuery with not_analyzed.
Do you have any idea about the quantity for each item. how I can get the quantity for each item?
Actually, I am using a multiMatchQuery without filters to get all docs and then programmingly get the quantity for each item(eg: category), and repeat it when applying to filter. this is duplicated.
there are two queries for each time. one for getting quantity without filter. The second for applying to filter. is there any improving suggest on this?
1°/ You do not have to count yourself, let Elasticsearch do it.
2°/ Note that it's also possible to run multiple query at one, this way you can run 1, 2, 3 or more
queries in only one time. Pretty usefull !
Absolutly, I'll have to read some doc et run some tests queries, but when I'll have understand how does it work, it'll be perfect for what you want to do
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.