Solr edismax相关性排序多个字段

时间:2017-04-29 12:44:34

标签: solr

我使用edismax查询解析器来处理针对我们的Solr 4.4服务器的用户查询。

我得到了正确的查询,但需要帮助确定优先顺序。

例如,如果我给q = ideapad miix 310

1)它将获得所有完全匹配,这工作正常。现在如果结果

包含ideapad而不是完全匹配的单词,它应该被赋予最低优先级

2)按此顺序对结果进行优先排序

field8,关键字,产品,营销,说明。此处还有ideapad

优先级最低。

MY bq:

private volatile bool doneUploading = false;

byte[] videoBytes = new byte[25000];
public Texture2D videoDisplay;

Action chachedUploader;

void Start()
{
    chachedUploader = uploadToTexture;
}

void uploadToTexture()
{
    UnityThread.executeInUpdate(() =>
    {
        //Upload the videobytes to Texture to display
        videoDisplay.LoadImage(videoBytes);
        doneUploading = true;
    });
}

//running in another Thread
void receiveVideoFrame()
{
    while (true)
    {
        //Download Video Frame 
        downloadVideoFrameFromNetwork(videoBytes);

        //Display Video Frame (Called on main thread)
        UnityThread.executeInUpdate(chachedUploader);

        //Wait until video is done uploading to Texture/Displayed
        while (!doneUploading)
        {
            Thread.Sleep(1);
        }

        //Done uploading Texture. Now set to false for the next run
        doneUploading = false;

        //Repeat again
    }
}

URL

bq:text:"ideapad miix 310"^20000  OR (text:"miix"^12000 -text:ideapad^-20 -text:thinkpad^-20 -text:ideacentre^-20 -text:thinkcentre^-20 text:"310"^1000 -text:ideapad^-20 -text:thinkpad^-20 -text:ideacentre^-20 -text:thinkcentre^-20)

我使用catch all field" text"并提升复制每个字段(field8,关键字等....)

http://localhost:8983/solr/collection1/select?q=ideapad+miix+310&defType=edismax&bq=text%3A%22ideapad+miix+310%22%5E20000++OR+(text%3A%22miix%22%5E12000+-text%3Aideapad%5E-20+-text%3Athinkpad%5E-20+-text%3Aideacentre%5E-20+-text%3Athinkcentre%5E-20+text%3A%22310%22%5E1000+-text%3Aideapad%5E-20+-text%3Athinkpad%5E-20+-text%3Aideacentre%5E-20+-text%3Athinkcentre%5E-20)

我对edismax的solrconfig我已经提升了字段

<field name="field8" type="text_search" indexed="true" stored="true" omitNorms="true"/>
    <field name="description" type="text_search" indexed="true" stored="true" omitNorms="true"/> 
   <field name="keywords" type="commaDelimited" indexed="true" stored="true"  omitNorms="true"/> 

  <field name="product" type="commaDelimited" indexed="true" stored="true" omitNorms="true" omitPositions="true" omitTermFreqAndPositions="true"/>
    <field name="marketing" type="commaDelimited_s" indexed="true" stored="true" omitNorms="true" omitPositions="true" omitTermFreqAndPositions="true"/>
<copyField source="field8" dest="text"/> 
<copyField source="field8" dest="text"/>  

0 个答案:

没有答案