Understading Solr nested queries

前端 未结 3 713
温柔的废话
温柔的废话 2021-01-23 22:11

I\'m trying to understand solr nested queries but I\'m having a problem undestading the syntax.

I have the following two indexed documents (among others):



        
3条回答
  •  执笔经年
    2021-01-23 23:00

    EDIT: When you say q=, are you specifying the query in a URL, or is the text after the q= being put in an application or the Solr dashboard? If we're talking about a URL, you may need to use percent-encoding to get it to work. I mentioned that below, but since I haven't heard from you, I thought I'd reiterate.

    Why don't you do q=name:"Fulano Silva" AND city:"fortaleza"?

    Another possibility: q=_query_:"{!edismax qf='name'}Fulano Silva" AND city:"fortaleza"

    If you're set on a nested query, select?defType=edismax&q="Fulano Silva" AND _query_:"{!edismax qf='city' v='fortaleza'}" should work, but the results and the way it matches will depend on what analyzers you are using to query and index name and city. Also, if these queries are in your query string, make sure you are encoding them properly.

    In order to help you any more, I need to know what you're trying to accomplish with your query. Then perhaps we can be sure you have the right indexing set up, that edismax is the right query handler, etc.

提交回复
热议问题