Elasticsearch regexp with space not working

前端 未结 1 1627
小鲜肉
小鲜肉 2021-01-22 02:28

Let\'s assume I have books with titles indexed with ElasticSearch as following:

curl -XPUT \"http://localhost:9200/_river/books/_meta\" -d\'
{
\         


        
相关标签:
1条回答
  • 2021-01-22 03:00

    Elasticsearch will apply the regexp to the terms produced by the tokenizer for that field, and not to the original text of the field.

    You can use different tokenizer for indexing your fields or define the regex in such a way that it returns required documents with high score.

    Example with keyword tokenizer:

    'regexp': { title: '*(foo bar)*' }
    
    0 讨论(0)
提交回复
热议问题