Hello Roberto,

Exact match needs extra " (double-quotes) surrounding the exact thing you want to query in the id field.
Give a try to a query like this :
id:"http://127.0.0.1:4444/my/personal/testuser/Personal Documents/cal9.pdf"

See this wiki page : http://wiki.apache.org/solr/SolrQuerySyntax and more precisely : http://lucene.apache.org/core/old_versioned_docs/versions/3_4_0/queryparsersyntax.html

From the debug output :
The first part was used to query the id field :
id:http://127.0.0.1:4444/my/personal/testuser/Personal
The query was only splitted on space and not on (characters like ':', '/', '.', etc because your id field must be of the string type, and no tokenization occur apart from the one of the query parser...)
The other parts, lacking a field operator, were queried against default search field (text) and it was splitted according to the tokenization of the text field as :
text:Documents
text:cal9
text:pdf

What happened more precisely is that nothing matched on the id:something part, only the textual content after the space matched in the text field.

Since the query got split into several part, a default query operator was used to perform a disjunction between the query terms.
You should provide your solr configuration and schema (solrconf.xml and schema.xml) when using the mailing list as it helps greatly debuging this.

Hope this helps,

--
Tanguy

Le 16/03/2012 08:55, Roberto Iannone a écrit :
Dear all,
 I've got an issue querying for the "id" field in solr. the "id" field is filled with document url taking from a sharepoint library using manifoldcf repository connector.

in my index there are these document ids:

<result name="response" numFound="5" start="0">
  <doc>
    <str name="id">
    http://localhost:4444/my/personal/testuser/Personal%20Documents/cal9.pdf</str>
  </doc>
  <doc>
    <str name="id">
    http://localhost:4444/my/personal/testuser/Personal%20Documents/cal1.pdf</str>
  </doc>
  <doc>
    <str name="id">
    http://localhost:4444/my/personal/testuser/Personal%20Documents/cal3.pdf</str>
  </doc>
  <doc>
    <str name="id">
    http://localhost:4444/my/personal/testuser/Personal%20Documents/cal17.pdf</str>
  </doc>
  <doc>
    <str name="id">
    http://localhost:4444/my/personal/testuser/Personal%20Documents/cal6.pdf</str>
  </doc>
</result>

When a submit this query:


I got the following (wrong) response from Solr:

<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">15</int>
    <lst name="params">
      <str name="q">
      id:http\://127.0.0.1\:4444/my/personal/testuser/Personal Documents/cal9.pdf</str>
      <str name="debugQuery">true</str>
      <str name="fl">id</str>
    </lst>
  </lst>
  <result name="response" numFound="1" start="0">
    <doc>
      <str name="id">
      http://127.0.0.1:4444/my/personal/testuser/Personal%20Documents/cal17.pdf</str>
    </doc>
  </result>
  <lst name="debug">
    <str name="rawquerystring">
    id:http\://127.0.0.1\:4444/my/personal/testuser/Personal Documents/cal9.pdf</str>
    <str name="querystring">
    id:http\://127.0.0.1\:4444/my/personal/testuser/Personal Documents/cal9.pdf</str>
    <str name="parsedquery">
    id:http://127.0.0.1:4444/my/personal/testuser/Personal (text:documents text:cal9 text:pdf)</str>
    <str name="parsedquery_toString">
    id:http://127.0.0.1:4444/my/personal/testuser/Personal (text:documents text:cal9 text:pdf)</str>
    <lst name="explain">
      <str name="http://127.0.0.1:4444/my/personal/testuser/Personal%20Documents/cal17.pdf">
      0.0024349838 = (MATCH) product of: 0.0048699677 = (MATCH) sum
      of: 0.0048699677 = (MATCH) product of: 0.014609902 = (MATCH)
      sum of: 0.014609902 = (MATCH) weight(text:pdf in 0), product
      of: 0.39035153 = queryWeight(text:pdf), product of: 1.9162908
      = idf(docFreq=1, maxDocs=5) 0.20370162 = queryNorm
      0.037427552 = (MATCH) fieldWeight(text:pdf in 0), product of:
      1.0 = tf(termFreq(text:pdf)=1) 1.9162908 = idf(docFreq=1,
      maxDocs=5) 0.01953125 = fieldNorm(field=text, doc=0)
      0.33333334 = coord(1/3) 0.5 = coord(1/2)</str>
    </lst>
    <str name="QParser">LuceneQParser</str>
    <lst name="timing">
      <double name="time">15.0</double>
      <lst name="prepare">
        <double name="time">0.0</double>
        <lst name="org.apache.solr.handler.component.QueryComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.FacetComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.HighlightComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.StatsComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.DebugComponent">

          <double name="time">0.0</double>
        </lst>
      </lst>
      <lst name="process">
        <double name="time">15.0</double>
        <lst name="org.apache.solr.handler.component.QueryComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.FacetComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.HighlightComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.StatsComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.DebugComponent">

          <double name="time">15.0</double>
        </lst>
      </lst>
    </lst>
  </lst>
</response>

Taking in account the dugug info, I escaped the (space) character with "\" but I got empty results with the response:

<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">0</int>
    <lst name="params">
      <str name="q">
      id:http\://127.0.0.1\:4444/my/personal/testuser/Personal\
      Documents/cal9.pdf</str>
      <str name="debugQuery">true</str>
      <str name="fl">id</str>
    </lst>
  </lst>
  <result name="response" numFound="0" start="0" />
  <lst name="debug">
    <str name="rawquerystring">
    id:http\://127.0.0.1\:4444/my/personal/testuser/Personal\
    Documents/cal9.pdf</str>
    <str name="querystring">
    id:http\://127.0.0.1\:4444/my/personal/testuser/Personal\
    Documents/cal9.pdf</str>
    <str name="parsedquery">
    id:http://127.0.0.1:4444/my/personal/testuser/Personal
    Documents/cal9.pdf</str>
    <str name="parsedquery_toString">
    id:http://127.0.0.1:4444/my/personal/testuser/Personal
    Documents/cal9.pdf</str>
    <lst name="explain" />
    <str name="QParser">LuceneQParser</str>
    <lst name="timing">
      <double name="time">0.0</double>
      <lst name="prepare">
        <double name="time">0.0</double>
        <lst name="org.apache.solr.handler.component.QueryComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.FacetComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.HighlightComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.StatsComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.DebugComponent">

          <double name="time">0.0</double>
        </lst>
      </lst>
      <lst name="process">
        <double name="time">0.0</double>
        <lst name="org.apache.solr.handler.component.QueryComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.FacetComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.HighlightComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.StatsComponent">

          <double name="time">0.0</double>
        </lst>
        <lst name="org.apache.solr.handler.component.DebugComponent">

          <double name="time">0.0</double>
        </lst>
      </lst>
    </lst>
  </lst>
</response>

Any suggestions ?

Cheers

Rob

--
Dott. Roberto Iannone

Ubuntu is ... "A traveller through a country would stop at a village and he didn't have to ask for food or for water. Once he stops, the people give him food, entertain him. That is one aspect of Ubuntu, but it will have various aspects. Ubuntu does not mean that people should not enrich themselves. The question therefore is: Are you going to do so in order to enable the community around you to be able to improve?" (Nelson Mandela)
--


src="">

Reply via email to