第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在彈性搜索中查找術(shù)語的出現(xiàn)

在彈性搜索中查找術(shù)語的出現(xiàn)

慕哥6287543 2021-09-15 15:05:06
我在JAVA 中對(duì) autosuggest使用彈性搜索,需要在索引中存儲(chǔ)術(shù)語及其出現(xiàn)。雖然索引產(chǎn)品,可以多次索引特定字符串。為了避免這種情況,如果它已經(jīng)存儲(chǔ),我們必須更新出現(xiàn)索引項(xiàng)。彈性搜索POJO:@Document(indexName = "autosuggest", type = "autosuggest")public class Autosuggest {@Id@Field(pattern ="id")private String id;@Field(pattern ="completion")private Completion completion;@Field(pattern ="occurence")private Integer occurence;public String getId() {    return id;}public Completion getCompletion() {    return completion;}public void setCompletion(Completion completion) {    this.completion = completion;}public Integer getOccurence() {    return occurence;}public void setOccurence(Integer occurence) {    this.occurence = occurence;}}完成對(duì)象public class Completion {private List<String> input;private Integer weight;public List<String> getInput() {    return input;}public void setInput(List<String> input) {    this.input = input;}public Integer getWeight() {    return weight;}public void setWeight(Integer weight) {    this.weight = weight;}public Completion(List<String> input, Integer weight) {    super();    this.input = input;    this.weight = weight;}}彈性搜索中的示例對(duì)象  {    "_index" : "autosuggest",    "_type" : "autosuggest",    "_id" : "BUj0zGUBr5AQqSH41l0m",    "_score" : 1.0,    "_source" : {      "completion" : {        "input" : [          "Casual Shirts for Men"        ],        "weight" : 2      },      "occurence" : 1    }  }如果該術(shù)語已在彈性搜索中編入索引,我該如何更新出現(xiàn)?
查看完整描述

2 回答

?
慕森王

TA貢獻(xiàn)1777條經(jīng)驗(yàn) 獲得超3個(gè)贊

這有效:


  "query": {

     "match": {

         "completion": "Casual Shirts for Men"

      }

  }


查看完整回答
反對(duì) 回復(fù) 2021-09-15
?
千巷貓影

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超7個(gè)贊

將此作為答案發(fā)布,因?yàn)槲覠o法發(fā)表評(píng)論。


@Priancy:您使用的查詢似乎不正確。請(qǐng)?jiān)谙旅嬲业秸_的查詢。我已使用您在問題中提供的示例對(duì)象測(cè)試了此查詢。


"query": {

    "match": {

      "completion.input": "Casual Shirts for Men"

    }

}

還請(qǐng)通過此鏈接了解如何跳過此方法并增加發(fā)生次數(shù)。


謝謝


查看完整回答
反對(duì) 回復(fù) 2021-09-15
  • 2 回答
  • 0 關(guān)注
  • 182 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)