You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Robin Wei <th...@163.com> on 2013/09/16 09:08:36 UTC

2 question about solr and lucene

Hi, guys:
    I met two questions about solr and lucene, wish people to help out.

use payload query but can NOT with numerical field type.  for example:                
        I implemented my own requesthandler, refer to http://hnagtech.wordpress.com/2013/04/19/using-payloads-with-solr-4-x/ 
         I query in solr:    sinaTag:operate
          solr response:

      "numFound": 2,
   "start": 0,    "maxScore": 99,    "docs": [      {        "id": "1628209010",
        "followersCount": 752,
        "sinaTag": "operate|99 C2C|98 B2C|97 OnlineShopping|96 E-commercial|94",
        "score": 99

           },

      {        "id": "1900546410",
        "followersCount": 1002,
        "sinaTag": "Startup|99 Benz|98 PublicRelation|97 operate|96 Activity|95 Media|94 AD|93 Vehicle|92 ",
              "score":   96

           }

        This work well. 
        But query with combined with other numberical condition, such as:
        sinaTag:operate and followersCount:[752 TO 752]
        {        "responseHeader": {        "status": 0,        "QTime": 40      },      "response": {        "numFound": 0,        "start": 0,        "maxScore": 0,        "docs": []      }
   }
   According these dataset, the first record should be responsed rather than NOT FOUND.
   I not know why.


 2. About string field fuzzy match filtering, how to get the score? what the formula is?
    When I used two or several string fuzzy match, probable AND or OR,  how to get the score? what the formula is?
    Might I implement myself score formula class which interface or abstract class to extend ?
   
        



Thanks in advance.




 

Re: 2 question about solr and lucene

Posted by Erick Erickson <er...@gmail.com>.
Are you saying you're trying to put payloads on the numeric data?
If that's the case I don't know how that works. But a couple of things:

sinaTag:operate and followersCount:[752 TO 752]

is incorrect, you must capitalize the and as

sinaTag:operate AND followersCount:[752 TO 752]

Your syntax _should_ work since [] is inclusive, but
I'd just try with 751 TO 753] once to be sure.

Attach &debug=all to your query and you'll see exactly how the
query is parsed. You'll also see exactly how the scores are
calculated in a long, complex bit of output. I _think_ that
fuzzy and wildcards do a "constant score query", so don't be
surprised if the calculations show you that the fuzzy matches don't
change the score.

Best,
Erick



On Mon, Sep 16, 2013 at 3:08 AM, Robin Wei <th...@163.com> wrote:

> Hi, guys:
>     I met two questions about solr and lucene, wish people to help out.
>
> use payload query but can NOT with numerical field type.  for example:
>         I implemented my own requesthandler, refer to
> http://hnagtech.wordpress.com/2013/04/19/using-payloads-with-solr-4-x/
>          I query in solr:    sinaTag:operate
>           solr response:
>
>       "numFound": 2,
>    "start": 0,    "maxScore": 99,    "docs": [      {        "id":
> "1628209010",
>         "followersCount": 752,
>         "sinaTag": "operate|99 C2C|98 B2C|97 OnlineShopping|96
> E-commercial|94",
>         "score": 99
>
>            },
>
>       {        "id": "1900546410",
>         "followersCount": 1002,
>         "sinaTag": "Startup|99 Benz|98 PublicRelation|97 operate|96
> Activity|95 Media|94 AD|93 Vehicle|92 ",
>               "score":   96
>
>            }
>
>         This work well.
>         But query with combined with other numberical condition, such as:
>         sinaTag:operate and followersCount:[752 TO 752]
>         {        "responseHeader": {        "status": 0,        "QTime":
> 40      },      "response": {        "numFound": 0,        "start": 0,
>    "maxScore": 0,        "docs": []      }
>    }
>    According these dataset, the first record should be responsed rather
> than NOT FOUND.
>    I not know why.
>
>
>  2. About string field fuzzy match filtering, how to get the score? what
> the formula is?
>     When I used two or several string fuzzy match, probable AND or OR,
>  how to get the score? what the formula is?
>     Might I implement myself score formula class which interface or
> abstract class to extend ?
>
>
>
>
>
> Thanks in advance.
>
>
>
>
>