我想在彈性搜索數據庫中插入6條記錄後進行彈性搜索。彈性搜索匹配查詢返回不正確的結果和得分
插入的記錄是簡單的JSON具有兩個屬性標識和文字
"OCC-001","Car Damaged During Loading"
"OCC-002","Car jango jango jango Damaged Loading"
"OCC-003","hjjkhjkasd hjkhjklhas d Cars asdasd jango asdsas jango jango Damaged asdsad asdasdasd Loading"
"OCC-004","This should not come at all "
"OCC-005","This may come Car"
"OCC-006","Will this come Cars"
我在做類似下面
SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(
matchQuery("title","Car Damaged"))
.build();
FacetedPage<Occurrence> occurrences = myElasticSearchRepository.search(searchQuery);
return occurrences;
我得到不正確的結果,並在錯誤的順序
搜索"OCC-005","This may come Car"
"OCC-001","Car Damaged During Loading"
"OCC-002","Car jango jango jango Damaged Loading"
當我使用下面的查詢做同樣的搜索時,我得到了正確的結果,但是在不同的順序
http://localhost:9200/myIndex/cars/_search?q=Car%20Damaged
"OCC-001","Car Damaged During Loading"
"OCC-002","Car jango jango jango Damaged Loading"
"OCC-005","This may come Car"
"OCC-003","hjjkhjkasd hjkhjklhas d Cars asdasd jango asdsas jango jango Damaged asdsad asdasdasd Loading"
貌似我是洞的東西根本不正確。
請注意。