2014-12-07 1 views
0

elasticsearch-mapper-attachments을 사용하여 색인 생성 된 첨부 파일 내용 내에서 ElasticSearch가 히트를 강조 표시하는 데 문제가 있습니다. /stuff/file에서ElasticSearch를 사용하여 첨부 파일 내용 내 히트 수를

내 데이터는 다음과 같습니다

{ 
    "file" : { 
     "properties" : { 
      "attachment" : { 
       "type" : "attachment", 
       "path" : "full", 
       "fields": { 
        "name": { "store": true }, 
        "title": { "store": true }, 
        "content": { "store": true }, 
        "attachment": { 
         "type": "string", 
         "term_vector": "with_positions_offsets", 
         "store": true 
        } 
       } 
      } 
     } 
    } 
} 

을 내가 /stuff/_mapper/file 그것을 쿼리 할 때 나는이 반환받을 :

{ 
    "id": "string" 
    "name": "string" 
    "attachment": "...base 64 encoded file" 
} 

/stuff/file/_mapper에 넣어 내 매퍼 구성은 다음과 같습니다

{ 
    "stuff":{ 
     "mappings":{ 
     "file":{ 
      "properties":{ 
       "attachment":{ 
        "type":"attachment", 
        "path":"full", 
        "fields":{ 
        "attachment":{ 
         "type":"string" 
        }, 
        "author":{ 
         "type":"string" 
        }, 
        "title":{ 
         "type":"string" 
        }, 
        "name":{ 
         "type":"string" 
        }, 
        "date":{ 
         "type":"date", 
         "format":"dateOptionalTime" 
        }, 
        "keywords":{ 
         "type":"string" 
        }, 
        "content_type":{ 
         "type":"string" 
        }, 
        "content_length":{ 
         "type":"integer" 
        }, 
        "language":{ 
         "type":"string" 
        } 
        } 
       }, 
       "id":{ 
        "type":"string" 
       }, 
       "name":{ 
        "type":"string" 
       } 
      } 
     } 
     } 
    } 
} 

내 검색어는 t 그의 :

{ 
    "size": 30, 
    "query": { 
     "multi_match": { 
      "query": "{{.Query}}", 
      "operator": "and", 
      "fields": ["id", "name^4", "attachment"], 
      "fuzziness": "AUTO", 
      "minimum_should_match": "80%" 
     } 
    }, 
    "highlight" : { 
     "fields" : { 
      "attachment": { } 
     } 
    } 
} 

내가 첨부 파일에있는 용어를 검색 할 때, 올바른 결과를 반환하지만 더 강조가 없습니다. 몇 년 전 비슷한 질문이 있었는데 attachmentfile으로 바꿨지 만 다시 변경되었다는 의견이있었습니다 ... 강조 표시를 작동 시키려면 어떤 구성이 필요합니까?

+0

동일한 문제가있는 iam ... 첨부 파일 강조 표시는 탄성 찾기 1.7에서 지원되지 않을까요? –

답변

0

PUT을 사용하여 매퍼 구성을 덮어 쓸 수 없다는 사실이 나타났습니다. 먼저 기존 구성을 삭제해야합니다 (실제로 전체 데이터베이스를 삭제 했으므로 구성상의 DELETE은 아무런 영향을 미치지 않습니다). 매퍼 구성이 실제로 업데이트되면 강조 표시가 제대로 작동합니다.