Elasticsearch not returning singular/plural matches

后端 未结 3 1081
名媛妹妹
名媛妹妹 2021-02-02 03:01

I am using a php library of elasticsearch to index and find documents in my website. This is the code for creating the index:

curl -XPUT \'http://localhost:9200/         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 03:33

    Somehow snowball is not working for me... am getting errors like I mentioned in the comment to @imotov's answer. I used porter stem and it worked perfectly for me. This is the config I used:

    curl -XPUT localhost:9200/index_name -d '
    {
    "settings" : {
        "analysis" : {
            "analyzer" : {
                "stem" : {
                    "tokenizer" : "standard",
                    "filter" : ["standard", "lowercase", "stop", "porter_stem"]
                }
            }
        }
    },
    "mappings" : {
        "index_type_1" : {
            "dynamic" : true,
            "properties" : {
                "field1" : {
                    "type" : "string",
                    "analyzer" : "stem"
                },
                "field2" : {
                    "type" : "string",
                    "analyzer" : "stem"
                }
             }
          }
       }
    }'
    

提交回复
热议问题