lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NickA <nickathen...@gmail.com>
Subject Re: Whole Phrase search in Solr
Date Mon, 03 Dec 2012 17:17:44 GMT
Thank you Erick and Jack,

Here is the code of an example query for “your”:

{
  "responseHeader":{
    "status":0,
    "QTime":15,
    "params":{
      "facet":"true",
      "fl":"*,score",
      "debugQuery":"on",
      "indent":"true",
      "q":"*:*",
      "hl.fl":"*",
      "json.nl":"map",
      "wt":"json",
      "fq":"ontology:your",
      "hl":"true"}},
  "response":{"numFound":54,"start":0,"maxScore":1.0,"docs":[
      {
        "id":"19",
        "question":"Do your products support RTL languges, like Arabic,
Hebrew, Persian, etc.? ",
        "answer":"",
        "tag":["Menu",
          "project",
…
  "debug":{
    "rawquerystring":"*:*",
    "querystring":"*:*",
    "parsedquery":"MatchAllDocsQuery(*:*)",
    "parsedquery_toString":"*:*",
    "explain":{
      "19":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "20":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "22":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "36":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "58":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "67":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "76":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "92":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "99":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n",
      "98":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
queryNorm\n"},
    "QParser":"LuceneQParser",
    "filter_queries":["ontology:your"],
    "parsed_filter_queries":["ontology:your"],
    "timing":{
      "time":15.0,
      "prepare":{
        "time":0.0,
        "org.apache.solr.handler.component.QueryComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.FacetComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.MoreLikeThisComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.HighlightComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.StatsComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.DebugComponent":{
          "time":0.0}},
      "process":{
        "time":15.0,
        "org.apache.solr.handler.component.QueryComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.FacetComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.MoreLikeThisComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.HighlightComponent":{
          "time":15.0},
        "org.apache.solr.handler.component.StatsComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.DebugComponent":{
          "time":0.0}}}}}

And here is the result of “your products”:

{
  "responseHeader":{
    "status":0,
    "QTime":2,
    "params":{
      "facet":"true",
      "fl":"*,score",
      "debugQuery":"on",
      "indent":"true",
      "q":"*:*",
      "hl.fl":"*",
      "json.nl":"map",
      "wt":"json",
      "fq":"ontology:\"your products\"",
      "hl":"true"}},
  "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{},
    "facet_dates":{},
    "facet_ranges":{}},
  "highlighting":{},
  "debug":{
    "rawquerystring":"*:*",
    "querystring":"*:*",
    "parsedquery":"MatchAllDocsQuery(*:*)",
    "parsedquery_toString":"*:*",
    "explain":{},
    "QParser":"LuceneQParser",
    "filter_queries":["ontology:\"your products\""],
    "parsed_filter_queries":["ontology:your products"],
    "timing":{
      "time":2.0,
      "prepare":{
        "time":1.0,
        "org.apache.solr.handler.component.QueryComponent":{
          "time":1.0},
        "org.apache.solr.handler.component.FacetComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.MoreLikeThisComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.HighlightComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.StatsComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.DebugComponent":{
          "time":0.0}},
      "process":{
        "time":1.0,
        "org.apache.solr.handler.component.QueryComponent":{
          "time":1.0},
        "org.apache.solr.handler.component.FacetComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.MoreLikeThisComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.HighlightComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.StatsComponent":{
          "time":0.0},
        "org.apache.solr.handler.component.DebugComponent":{
          "time":0.0}}}}}

When I have the double quotes, then it never finds anything. Is this because
the index is tokenized, so only single words can be matched? 

But I also tried with “solr.KeywordTokenizerFactory” in the index and it
still did not work (currently it is only in the search).





--
View this message in context: http://lucene.472066.n3.nabble.com/Whole-Phrase-search-in-Solr-tp4023931p4024038.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message