elasticsearch의 패싯 기능을 사용하여 단어와 구의 tagcloud를 만들려고합니다."패싯"쿼리에서 제공되는 "제외"단어 옵션을 사용하여 n 개의 단조 (n - gram) 패싯을 필터링 할 수 없습니다
내 매핑 : 생성 측면에 대한
curl -XPOST http://localhost:9200/myIndex/ -d '{
...
"analysis":{
"filter":{
"myCustomShingle":{
"type":"shingle",
"max_shingle_size":3,
"output_unigrams":true
}
},
"analyzer":{ //making a custom analyzer
"myAnalyzer":{
"type":"custom",
"tokenizer":"standard",
"filter":[
"lowercase",
"myCustomShingle",
"stop"
]
}
}
}
...
},
"mappings":{
...
"description":{ //the field to be analyzed for making the tag cloud
"type":"string",
"analyzer":"myAnalyzer",
"null_value" : "null"
},
...
}
검색어 :
curl -X POST "http://localhost:9200/myIndex/myType/_search?&pretty=true" -d '
{
"size":"0",
"query": {
match_all:{}
},
"facets": {
"blah": {
"terms": {
"fields" : ["description"],
"exclude" : [ 'evil' ], //remove facets that contain these words
"size": "50"
}
}
}
}
내 문제이고, 나는 단어 "면"의 "제외"옵션에서 '악마'라고 삽입 할 때, '악마'와 일치하는 단어 (또는 단일 shingles)가 포함 된 패싯을 성공적으로 제거합니다. 하지만 2/3 단어 대상 포진, "주민 악", "악의적 인 컴퓨터", "내 사악한 고양이"는 제거되지 않습니다. "제외 단어"가 포함 된 문구의면을 제거하려면 어떻게합니까?
"스크립트"에 넣어야 할 항목 : 여러 개의 제외 단어 [ 'evil', 'i' , 'a', 'the']? – serpent403
[mvel operators] (http://mvel.codehaus.org/Operators)를 살펴보십시오. 나는 당신이 그들을 OR에 넣을 수 있었다고 생각합니다. 예를 들어'term.contains ('evil') || term.contains ('i')'등 – javanna
사실 나는 엄청난 양의 그러한 정지 키워드 데이터를 가지고있다. 이것이 올바른 방법일까요? 다른 방법이 있습니까? – serpent403