We are implementing Site search using Elastic Search standalone version.
We need to know how can we direct a search term to a category and list products from that category
**For example : ** Search term is "wash basin tap"
Should match wash basin tap & basin tap in documents
Should not match **wash basin, washbasin alone ** in documents
As wash basin taps type products are mapped under Faucets, Long Bib Taps, Automatic Wash Taps, Need to show products from these categories- How to pull based on "wash basin tap" category ?
Thanks @Christian_Dahlqvist, But my concern is how can i route my search term to a category
Can i have some custom analyser to do this or any other mapping text file ?
For that part I suspect you will need to use 2 separate queries. First get matching items and then other documents that match the categories retrieved.
I am not sure that I understand what you mean. It sounds to me like you want to enrich the initial results based on the data retrieved in the search. This will require 2 separate searches as Elasticsearch does not support joins or subqueries.
If i search for "wash basin taps", I need to add Faucets, Long Bib Taps, Automatic Wash Taps categories to my search query against category filed to match & get results.
For this, how can i do a mapping between search terms vs categories. Can it be done via custom analyser or any painless function ? - Just a wild guess, correct me if i am wrong !
I was assuming you perform the search for "wash basin taps" and then extract categories from the results and run a second query to retrieve results matching these categories. Is this not logically what you are looking to do? If you do not get categories from the initial search result, how do you determine them?
If this logically is what you are looking for, I do not see any way of doing that with a single query.
Actually search alone is not giving relevant matches, because different names are present like faucets, handbowl bip tap, long bip taps. Also i should not match "washbasin or wash basin". So i was looking an approach where with some kind of a mapping if i get a list of closest categories, I can do it in a single shot !
Even if i want to do it in 2nd query, the matching may not yield all the categories from 1st query.
FYI: We are searching through fields like Title, Keywords and 3 level categories mainly in ES query. We have a field which stores possible keywords to define this product.
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.