0
votes

I have uploaded and extract document in solr 6.0.0 and I see that it is indexed using the following query:

http://localhost:8983/solr/techproducts/select?indent=on&q=id:doc1&wt=json

{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "q":"id:doc1",
      "indent":"on",
      "wt":"json"}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "links":["http://www.education.gov.yk.ca/"],
        "id":"doc1",
        "last_modified":"2008-06-04T22:47:36Z",
        "title":[" PDF Test Page"],
        "content_type":["application/pdf"],
        "author":"Yukon Canada Yukon Department of Education",
        "author_s":"Yukon Canada Yukon Department of Education",
        "content":[" \n \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  PDF Test Page \n \n    \n  \n \nPDF Test File \n \nCongratulations, your computer is equipped with a PDF (Portable Document Format) \nreader!  You should be able to view any of the PDF documents and forms available on \nour site.  PDF forms are indicated by these icons:   or  .   \n \nYukon Department of Education \nBox 2703 \nWhitehorse,Yukon \nCanada \nY1A 2C6 \n \nPlease visit our website at:  http://www.education.gov.yk.ca/\n    \n  \n    \n \n  "],
        "_version_":1533049305513852928}]
  }}

I see that the field content has a number of occurrences of word PDF.

Why I am getting no result with the following query, when there is a field name content and it contains PDF inside?:

select?q=*:*&fq=content:PDF

{
  "responseHeader":{
    "status":0,
    "QTime":4,
    "params":{
      "q":"*:*",
      "indent":"on",
      "fq":"content:PDF",
      "rows":"50",
      "wt":"json"}},
  "response":{"numFound":0,"start":0,"docs":[]
  }}

When I query using different field, for example title, then I have the right result:

select?q=*:*&fq=title:PDF

{
  "responseHeader":{
    "status":0,
    "QTime":3,
    "params":{
      "q":"*:*",
      "indent":"on",
      "fq":"title:PDF",
      "rows":"50",
      "wt":"json"}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "links":["http://www.education.gov.yk.ca/"],
        "id":"doc1",
        "last_modified":"2008-06-04T22:47:36Z",
        "title":[" PDF Test Page"],
        "content_type":["application/pdf"],
        "author":"Yukon Canada Yukon Department of Education",
        "author_s":"Yukon Canada Yukon Department of Education",
        "content":[" \n \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  PDF Test Page \n \n    \n  \n \nPDF Test File \n \nCongratulations, your computer is equipped with a PDF (Portable Document Format) \nreader!  You should be able to view any of the PDF documents and forms available on \nour site.  PDF forms are indicated by these icons:   or  .   \n \nYukon Department of Education \nBox 2703 \nWhitehorse,Yukon \nCanada \nY1A 2C6 \n \nPlease visit our website at:  http://www.education.gov.yk.ca/\n    \n  \n    \n \n  "],
        "_version_":1533049305513852928}]
  }}
1
will you please share the schema.xml... - Abhijit Bashetti

1 Answers

0
votes

Check your schema.xml for the field type defined for content field.

Compare the field type of content and title field.

It might be the case that you are not having proper field type defined for your field content. These field type are not generating any token for your text or must be considering the entire text as one. This happens in case if you are using keywordtokenizer or string field type for your field.

You can check the check the same or analyze the in Solr debugger tool.

Here you can check how the text is been indexed and how the text is searched.

When you want to search on a field then you have to mention the attribute indexed=true and you want solr to return the value of the same then you need add stored=true.

These two attribute helps you to achieve search and retrieve the original value of the field