使用Boosting进行复杂的嵌套数组搜索

问题描述

所以我有一个弹性索引,其中包含数千个文档,每个文档都具有以下相当复杂的结构,我需要按以下方式进行搜索

让我说我有以下搜索字符串:“我单身,有一只狗”,我需要能够

搜索所有doc.ratedTags.tags.keywords和所有doc。describeTagCombos.tags.keywords,但是对匹配的doc.ratedTags.tags.keywords评分较高的匹配项进行了改进

我不认为这是不可能的

{
    "_index": "neighborhood","_type": "neighborhood","_id": "2338","_version": 1,"_seq_no": 0,"_primary_term": 1,"found": true,"_source": {
        "id": 2338,"neighborhoodId": 4427,"name": "East Village","xMin": -73.9926238051035,"xMax": -73.9718363715137,"xAvg": -73.9822300883086,"yMin": 40.7192801452175,"yMax": 40.7337200243512,"yAvg": 40.7265000847843,"city": {
            "id": 393,"name": "New York City-Manhattan","county": "New York","state": {
                "id": 118,"name": "New York","abbreviation": "NY","country": "USA"
            }
        },"ratedTags": [
            {
                "id": 1064,"rating": 4,"tags": [
                    {
                        "id": 213,"tagId": 15,"name": "restaurants","synonym": "","keywords": "restaurants,restaurant,eatery,eateries"
                    }
                ]
            },{
                "id": 995,"rating": 5,"tags": [
                    {
                        "id": 199,"tagId": 1,"name": "artists and creative types","keywords": "artsy,artistic,artists,creative types,musicians,artist,creative type,musician"
                    }
                ]
            }
        ],"describedTagCombos": [
            {
                "id": 9524,"descriptor": "Area has tons of excellent bars,restaurants,and fun that appeals to post-college,students,and creative types",eateries"
                    },{
                        "id": 219,"tagId": 21,"name": "nightlife","keywords": "nightlife,bars,nightclubs,lounge,lounges,nightclub,bar,clubs,club,party,parties,night,pubs,tavern,sports bar,taverns,pub,wine bar,night life,night club,night clubs,sportsbar,sportsbars,night light,night lights,nightlight,nite light"
                    },{
                        "id": 226,"tagId": 28,"name": "bar scene","keywords": "bar scene,taverns"
                    },{
                        "id": 238,"tagId": 40,"name": "dining options","keywords": "dining places,dining spots,dining options,food options,food places,places to eat,eateries,dining,fast food,chain restaurant,chain restaurants,eatery"
                    }
                ]
            },{
                "id": 9525,"descriptor": "Traveler Tip: walk around St Marks and check out the shops,people,& vibe","tags": [
                    {
                        "id": 235,"tagId": 37,"name": "tourist attractions","synonym": "sightseeing options","keywords": "tourist attractions,sightseeing,attractions,sightsee,tourist"
                    },{
                        "id": 236,"tagId": 38,"name": "entertainment options","synonym": "fun options","keywords": "fun,entertainment,good time,enjoyment,enjoy,pleasure"
                    }
                ]
            }
            
        ]
    }
}
"_nayberz": {
      "type": "text","analyzer": "autocomplete","store": true
    },
...
"keywords": {
              "type": "text","copy_to": "_nayberz"
            },

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...