W
W
WebDev2017-05-23 11:35:29
elasticsearch
WebDev, 2017-05-23 11:35:29

Search engine?

Recently I needed a search with typos and so on. Installed elasticsearch. Out of the box, the search works well, but I couldn't manage to sort the result alphabetically. For example, there are phrases:

System of a down
My own system
System 27
Presystem
Systemode

I need the user to write "system" to get first of all the lines that begin with this word. Elasticsearch, by default, indexes each word in a phrase separately and gives the result not as I need. I tried to change the tokenizer and so on. Tried something like this:
{
    "settings": {
        "index": {
            "analysis": {
                "analyzer": {
                    "analyzer_startswith": {
                        "tokenizer": "keyword",
                        "filter": "lowercase"
                    }
                }
            }
        }
    },
    "mappings": {
        "test_index": {
            "properties": {
                "title": {
                    "search_analyzer": "analyzer_startswith",
                    "index_analyzer": "analyzer_startswith",
                    "type": "string"
                }
            }
        }
    }
}

And search with match_phrase_prefix. But in this case, the search with typos stops working. In general, as I just did not experiment, I could not set up such a simple thing. Elastik's documentation is terrible!
Tell me, how is it with other engines, such as sphinx or solr? Easier in terms of setup.
What engine are you using?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2017-05-23
@xmoonlight

Search Stumper

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question