Elasticsearch synonyms

  • hi,
  • I set up the synonyms filter, but I have not good results. I have an
    exception :
  • error: SearchPhaseExecutionException[Failed to execute phase
    [query_fetch], total failure; shardFailures
    {[_Bs3I2A4Q1SmiOilLIEQJA][magento][0]: SearchParseException[[magento][0]:
    query[(name_fr.name_fr:ipad | name_fr.whitespace:ipad |
    (name_fr.edge_ngram_front:ip name_fr.edge_ngram_front:ipa
    name_fr.edge_ngram_front:ipad) | (name_fr.edge_ngram_back:ad
    name_fr.edge_ngram_back:pad name_fr.edge_ngram_back:ipad) |
    name_fr.shingle:ipad | name_fr.shingle_strip_ws:ipad |
    name_fr.shingle_strip_apos_and_ws:ipad | name_fr.analyzer_fr:ipad |
    manufacturer:ipad | description_fr.description_fr:ipad |
    (description_fr.synonym:ipad description_fr.synonym:i
    description_fr.synonym:i-pad description_fr.synonym:pad) |
    description_fr.whitespace:ipad | (description_fr.edge_ngram_front:ip
    description_fr.edge_ngram_front:ipa description_fr.edge_ngram_front:ipad) |
    (description_fr.edge_ngram_back:ad description_fr.edge_ngram_back:pad
    description_fr.edge_ngram_back:ipad) | description_fr.shingle:ipad |
    description_fr.shingle_strip_ws:ipad |
    description_fr.shingle_strip_apos_and_ws:ipad |
    description_fr.analyzer_fr:ipad | isbn_fr:ipad | manufacturer_facet:ipad |
    article_code_manufacturer:ipad | ean:ipad |
    book_author:ipad)],from[-1],size[8]: Parse Failure [Failed to parse source
    [{"query":{"query_string":{"query":"ipad","fields":["name_fr.name_fr","name_fr.whitespace","name_fr.edge_ngram_front","name_fr.edge_ngram_back","name_fr.shingle","name_fr.shingle_strip_ws","name_fr.shingle_strip_apos_and_ws","name_fr.analyzer_fr","manufacturer","description_fr.description_fr","description_fr.synonym","description_fr.whitespace","description_fr.edge_ngram_front","description_fr.edge_ngram_back","description_fr.shingle","description_fr.shingle_strip_ws","description_fr.shingle_strip_apos_and_ws","description_fr.analyzer_fr","isbn_fr","manufacturer_facet","article_code_manufacturer","ean","book_author"]}},"min_score":0.2,"size":8,"filter":{"synonym":{"type":"synonym","synonyms":["i-pod,
    i pod => ipod","universe,
    cosmos"]},"and":[{"prefix":{"name_fr.shingle_strip_ws":"min"}},{"query":{"query_string":{"query":"exists:type_products_fr"}}}]}}]]];
    nested: QueryParsingException[[magento] No filter registered for
    [synonym]]; }]
  • status: 500

this is my settings :

  • index.analysis.analyzer.synonym.tokenizer: whitespace
  • index.analysis.analyzer.edge_ngram_back.tokenizer: standard
  • index.analysis.filter.shingle.output_unigrams: true
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.3: length
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.2:
    strip_whitespaces
  • index.analysis.filter.snowball_fr.type: snowball
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.4: lowercase
  • index.analysis.filter.shingle.type: shingle
  • index.analysis.filter.strip_whitespaces.type: pattern_replace
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.1:
    strip_apostrophes
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.0: shingle
  • index.analysis.filter.edge_ngram_front.min_gram: 2
  • index.analysis.filter.length.min: 2
  • index.analysis.filter.edge_ngram_back.side: back
  • index.analysis.filter.strip_apostrophes.replacement:
  • index.analysis.filter.strip_whitespaces.pattern: \s
  • index.analysis.analyzer.shingle_strip_ws.tokenizer: standard
  • index.analysis.filter.edge_ngram_front.max_gram: 10
  • index.analysis.analyzer.edge_ngram_front.tokenizer: standard
  • index.analysis.analyzer.edge_ngram_back.filter.1: edge_ngram_back
  • index.analysis.analyzer.edge_ngram_back.filter.2: lowercase
  • index.analysis.analyzer.edge_ngram_back.filter.0: length
  • index.analysis.filter.length.type: length
  • index.number_of_shards: 1
  • index.analysis.filter.strip_apostrophes.pattern: '
  • index.analysis.analyzer.synonym.filter.0: synonym
  • index.analysis.analyzer.shingle.filter.2: lowercase
  • index.analysis.analyzer.shingle.filter.0: shingle
  • index.analysis.filter.shingle.max_shingle_size: 20
  • index.analysis.analyzer.shingle.filter.1: length
  • index.analysis.filter.edge_ngram_back.max_gram: 10
  • index.analysis.analyzer.edge_ngram_front.filter.0: length
  • index.analysis.filter.synonym.synonyms_path: analysis/synonym.txt
  • index.analysis.analyzer.edge_ngram_front.filter.1: edge_ngram_front
  • index.analysis.analyzer.analyzer_fr.tokenizer: standard
  • index.analysis.analyzer.edge_ngram_front.filter.2: lowercase
  • index.version.created: 191099
  • index.analysis.analyzer.whitespace.tokenizer: standard
  • index.analysis.analyzer.shingle.tokenizer: standard
  • index.analysis.filter.snowball_fr.language: French
  • index.analysis.analyzer.whitespace.filter.0: lowercase
  • index.number_of_replicas: 1
  • index.analysis.analyzer.analyzer_fr.type: custom
  • index.analysis.filter.edge_ngram_front.type: edgeNGram
  • index.analysis.analyzer.shingle_strip_apos_and_ws.tokenizer: standard
  • index.analysis.filter.synonym.type: synonym
  • index.analysis.filter.strip_apostrophes.type: pattern_replace
  • index.analysis.filter.edge_ngram_back.type: edgeNGram
  • index.analysis.analyzer.shingle_strip_ws.filter.3: lowercase
  • index.analysis.analyzer.shingle_strip_ws.filter.2: length
  • index.analysis.analyzer.shingle_strip_ws.filter.1: strip_whitespaces
  • index.analysis.analyzer.shingle_strip_ws.filter.0: shingle
  • index.analysis.analyzer.analyzer_fr.filter.0: length
  • index.analysis.analyzer.analyzer_fr.filter.1: lowercase
  • index.analysis.filter.strip_whitespaces.replacement:
  • index.analysis.analyzer.analyzer_fr.filter.2: snowball_fr
  • index.analysis.filter.edge_ngram_front.side: front
  • index.analysis.filter.edge_ngram_back.min_gram: 2

thank you

--
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.

Hey,

can you provide some more information for us to take a closer look at the
issue? Maybe as a gist at github:

  • Mapping of the index you are querying
  • Your query
  • Configuration of your analyzers/filters in your yaml file (if available)
    or index configuration. The configuration you already posted is there, but
    a bit fragmented (I just want to make sure, not having overlooked
    something).
  • Sample indexed document

On Wed, Mar 27, 2013 at 7:51 PM, Fadel Chafai fadelmohamed@gmail.comwrote:

  • hi,
  • I set up the synonyms filter, but I have not good results. I have an
    exception :
  • error: SearchPhaseExecutionException[Failed to execute phase
    [query_fetch], total failure; shardFailures
    {[_Bs3I2A4Q1SmiOilLIEQJA][magento][0]: SearchParseException[[magento][0]:
    query[(name_fr.name_fr:ipad | name_fr.whitespace:ipad |
    (name_fr.edge_ngram_front:ip name_fr.edge_ngram_front:ipa
    name_fr.edge_ngram_front:ipad) | (name_fr.edge_ngram_back:ad
    name_fr.edge_ngram_back:pad name_fr.edge_ngram_back:ipad) |
    name_fr.shingle:ipad | name_fr.shingle_strip_ws:ipad |
    name_fr.shingle_strip_apos_and_ws:ipad | name_fr.analyzer_fr:ipad |
    manufacturer:ipad | description_fr.description_fr:ipad |
    (description_fr.synonym:ipad description_fr.synonym:i
    description_fr.synonym:i-pad description_fr.synonym:pad) |
    description_fr.whitespace:ipad | (description_fr.edge_ngram_front:ip
    description_fr.edge_ngram_front:ipa description_fr.edge_ngram_front:ipad) |
    (description_fr.edge_ngram_back:ad description_fr.edge_ngram_back:pad
    description_fr.edge_ngram_back:ipad) | description_fr.shingle:ipad |
    description_fr.shingle_strip_ws:ipad |
    description_fr.shingle_strip_apos_and_ws:ipad |
    description_fr.analyzer_fr:ipad | isbn_fr:ipad | manufacturer_facet:ipad |
    article_code_manufacturer:ipad | ean:ipad |
    book_author:ipad)],from[-1],size[8]: Parse Failure [Failed to parse source
    [{"query":{"query_string":{"query":"ipad","fields":["name_fr.name_fr","name_fr.whitespace","name_fr.edge_ngram_front","name_fr.edge_ngram_back","name_fr.shingle","name_fr.shingle_strip_ws","name_fr.shingle_strip_apos_and_ws","name_fr.analyzer_fr","manufacturer","description_fr.description_fr","description_fr.synonym","description_fr.whitespace","description_fr.edge_ngram_front","description_fr.edge_ngram_back","description_fr.shingle","description_fr.shingle_strip_ws","description_fr.shingle_strip_apos_and_ws","description_fr.analyzer_fr","isbn_fr","manufacturer_facet","article_code_manufacturer","ean","book_author"]}},"min_score":0.2,"size":8,"filter":{"synonym":{"type":"synonym","synonyms":["i-pod,
    i pod => ipod","universe,
    cosmos"]},"and":[{"prefix":{"name_fr.shingle_strip_ws":"min"}},{"query":{"query_string":{"query":"exists:type_products_fr"}}}]}}]]];
    nested: QueryParsingException[[magento] No filter registered for
    [synonym]]; }]
  • status: 500

this is my settings :

  • index.analysis.analyzer.synonym.tokenizer: whitespace
  • index.analysis.analyzer.edge_ngram_back.tokenizer: standard
  • index.analysis.filter.shingle.output_unigrams: true
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.3: length
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.2:
    strip_whitespaces
  • index.analysis.filter.snowball_fr.type: snowball
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.4: lowercase
  • index.analysis.filter.shingle.type: shingle
  • index.analysis.filter.strip_whitespaces.type: pattern_replace
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.1:
    strip_apostrophes
  • index.analysis.analyzer.shingle_strip_apos_and_ws.filter.0: shingle
  • index.analysis.filter.edge_ngram_front.min_gram: 2
  • index.analysis.filter.length.min: 2
  • index.analysis.filter.edge_ngram_back.side: back
  • index.analysis.filter.strip_apostrophes.replacement:
  • index.analysis.filter.strip_whitespaces.pattern: \s
  • index.analysis.analyzer.shingle_strip_ws.tokenizer: standard
  • index.analysis.filter.edge_ngram_front.max_gram: 10
  • index.analysis.analyzer.edge_ngram_front.tokenizer: standard
  • index.analysis.analyzer.edge_ngram_back.filter.1: edge_ngram_back
  • index.analysis.analyzer.edge_ngram_back.filter.2: lowercase
  • index.analysis.analyzer.edge_ngram_back.filter.0: length
  • index.analysis.filter.length.type: length
  • index.number_of_shards: 1
  • index.analysis.filter.strip_apostrophes.pattern: '
  • index.analysis.analyzer.synonym.filter.0: synonym
  • index.analysis.analyzer.shingle.filter.2: lowercase
  • index.analysis.analyzer.shingle.filter.0: shingle
  • index.analysis.filter.shingle.max_shingle_size: 20
  • index.analysis.analyzer.shingle.filter.1: length
  • index.analysis.filter.edge_ngram_back.max_gram: 10
  • index.analysis.analyzer.edge_ngram_front.filter.0: length
  • index.analysis.filter.synonym.synonyms_path: analysis/synonym.txt
  • index.analysis.analyzer.edge_ngram_front.filter.1: edge_ngram_front
  • index.analysis.analyzer.analyzer_fr.tokenizer: standard
  • index.analysis.analyzer.edge_ngram_front.filter.2: lowercase
  • index.version.created: 191099
  • index.analysis.analyzer.whitespace.tokenizer: standard
  • index.analysis.analyzer.shingle.tokenizer: standard
  • index.analysis.filter.snowball_fr.language: French
  • index.analysis.analyzer.whitespace.filter.0: lowercase
  • index.number_of_replicas: 1
  • index.analysis.analyzer.analyzer_fr.type: custom
  • index.analysis.filter.edge_ngram_front.type: edgeNGram
  • index.analysis.analyzer.shingle_strip_apos_and_ws.tokenizer: standard
  • index.analysis.filter.synonym.type: synonym
  • index.analysis.filter.strip_apostrophes.type: pattern_replace
  • index.analysis.filter.edge_ngram_back.type: edgeNGram
  • index.analysis.analyzer.shingle_strip_ws.filter.3: lowercase
  • index.analysis.analyzer.shingle_strip_ws.filter.2: length
  • index.analysis.analyzer.shingle_strip_ws.filter.1: strip_whitespaces
  • index.analysis.analyzer.shingle_strip_ws.filter.0: shingle
  • index.analysis.analyzer.analyzer_fr.filter.0: length
  • index.analysis.analyzer.analyzer_fr.filter.1: lowercase
  • index.analysis.filter.strip_whitespaces.replacement:
  • index.analysis.analyzer.analyzer_fr.filter.2: snowball_fr
  • index.analysis.filter.edge_ngram_front.side: front
  • index.analysis.filter.edge_ngram_back.min_gram: 2

thank you

--
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.

--
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.