elasticsearch - Implementing search : Identifying known keywords -


i have implemented search functionality e-commerce website using elastic search. basic structure like, each product has title , whatever user enters search exact string using elastic , return result.

now notice of search phrases (almost 90%) follow similar pattern. contains:

  1. brand name of product (apple, nokia etc.)
  2. category of product (phone, mobile phone, smartphone etc.)
  3. model name of product (iphone 6s, lumia 950 etc.)

now think if able identify specific components, can return better results text match.

i have list of brands, categories , models. if able identify terms present, can request elasticsearch field example, search string of "apple iphone 5s", should able deduce brand=apple.

edit: more details asked in comments

structure of document:

i have single index , each document id sku of product , contains following fields

  1. title (apple iphone 5s)
  2. brand (apple)
  3. categ (electronics)
  4. sub_categ (smartphones)
  5. model (iphone 5s)
  6. attribs (dictionary of product attributes particular each sub_categ {"color": "gold", "memory": "32 gb", "battery": "1570 mah"})
  7. price

use case:

now when user searches phrase "iphone 5s battery", elastic returns search results returns phone. (i agree relevance score matches better battery)

what trying achieve is, have master list of sub categories. if word search phrase present in master list, search on elasticsearch query ["must": {"sub_categ": "battery"}]. result "smartphones" sub category not fetched elastic. wish replicate across multiple fields brand, category etc

my question is, how find if brand or other particular word master list if present in search phrase quickly? option think of is, looping through master list , check if word present in search phrase. if present, keep note of , same across master list field (brand, categ, sub categ). generate query must , querying them. wish know if there better way of accomplishing it.

the person in lucene world has spoken on topic ted sullivan. (he calls "auto-filtering", , has a component available solr)

i realize you're using elasticsearch, ted's component works introspecting fieldcache data (exposed lucene) should possible implement similar elasticsearch (look @ code).

there discussion in this article how create separate index providing pre-query intelligence you've described (e.g. term "apple" found in company field).


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -