0

Is it possible to configure the elasticsearch index behavior to ack as the LIKE keyword of SQL.

If the index contains "This document is called MySuperInvoice", I want to be able to find it if I am looking for super, doc or voice"

Thank you for your help.

Edit:

Somebody tells me that I need to put * around my search terms : *query*

Lets see how this can be done using haystack.

Natim
  • 17,274
  • 23
  • 92
  • 150
  • Could you add a question? What is your issue? – dadoonet Jan 04 '13 at 17:18
  • Yes the question is how should I do? I tried with this configuration but it doesn't seams to work. Do you have any idea of how I should configure ElasticSearch so it act like I want? – Natim Jan 04 '13 at 22:40
  • Perhaps can you post here your curl commands to help us to reproduce your issue. I mean: a document, a search request at least. – dadoonet Jan 06 '13 at 07:33
  • I am using haystack as an elasticsearch backend so i don't write my own json curl requests. But I would like to configure directly this behaviour for all requests in the ``/etc/elasticsearch/elasticsearch.yml`` file – Natim Jan 06 '13 at 14:15
  • Similar question: https://stackoverflow.com/questions/44791075/in-elasticsearch-how-do-i-search-for-an-arbitrary-substring – Patrick Szalapski Jun 28 '17 at 02:31

2 Answers2

1

Ok I finally got there. Thanks @zebuline.

cluster:
        name: webapp
network:
        bind_host: 0.0.0.0
        publish_host: _eth0_
index:
        analysis:
                analyzer:
                        default_index:
                                type:           custom
                                tokenizer:      standard
                                filter:         [standard, lowercase, asciifolding, webapp_ngram]
                        default_search:
                                type:           custom
                                tokenizer:      standard
                                filter:         [standard, lowercase, asciifolding]
                filter:
                        webapp_ngram:
                                type:           nGram
                                min_gram:       1
                                max_gram:       30
Natim
  • 17,274
  • 23
  • 92
  • 150
-1

Have a look at default mapping in ES. It should help you.

http://www.elasticsearch.org/guide/reference/mapping/dynamic-mapping.html

dadoonet
  • 14,109
  • 3
  • 42
  • 49