Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8632101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:18:23+00:00 2026-06-12T09:18:23+00:00

I am able to upload the pdf files into solr and I am able

  • 0

I am able to upload the pdf files into solr and I am able to search those files. But what is indexing in solr? Wwhen I upload a pdf file how it will do the indexing?

This is the code I use to upload the pdf file

ContentStreamUpdateRequest up 
            = new ContentStreamUpdateRequest("/update/extract");

            up.addFile(fileName);

            up.setParam("literal.id", solrId);
            up.setParam("literal.first_name", "apachesolr");
            up.setParam("literal.last_name", "cookbook");
            up.setParam("literal.age", "30");

            up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);

            solrServer.request(up);

below is my schema.xml

    <field name="first_name" type="string" indexed="true" stored="true" required="true"/>

<field name="last_name" type="string" indexed="true" stored="true" required="true"/>
<field name="age" type="int" indexed="true" stored="true" required="true"/>

<field name="created_at" type="date" indexed="true" stored="true"/>
<field name="updated_at" type="date" indexed="true" stored="true"/>
<field name="id" type="string" indexed="true" stored="true" required="true"/>

when i am searching with the any content in the pdf. the result look like this

  SolrDocument[{
last_modified=Fri Oct 17 08:17:38 IST 2003, 
author=Mark Roth, Eduardo Pelegri-Llopart, 
title=[JSP 2.0 Specification, Final Release], 
content_type=[application/pdf], 
keywords=JSP, 
age=30, 
last_name=cookbook, 
first_name=apachesolr, 
id=jsp-2_0-fr-spec.pdf
}]

How it will be able to get the title, author, keywords… etc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:18:23+00:00Added an answer on June 12, 2026 at 9:18 am

    You misunderstand concept of document in search engines. Document is a set of named fields with corresponding values. You should always explicitly set each field. To start with, try the following code with Solrj:

    CommonsHttpSolrServer solr = new CommonsHttpSolrServer("http://localhost:8983/solr");
    for(int i = 0; i < 1000; ++i) {
      SolrInputDocument doc = new SolrInputDocument();
      doc.addField("title", "My Favorite book");
      doc.addField("author", "Kevin");
      doc.addField("content", "Bla bla bla");
      solr.add(doc);
    }
    solr.commit(); 
    

    This code creates new SolrInputDocument and adds 3 fields – “title”, “author” and “content” (note: all these fields should be defined in schema.xml, just to let Solr know how to index and store these fields), then it adds new doc to transaction (solr.add(doc)) and finally commits changes. This is the basic way to work with Solr.

    In this normal flow you should extract text from documents yourself. For example, you may use Tika for this purpose. This is the most flexible and fine-grained way.

    What you are trying to do is to use new Solr feature – content extraction. If I understand it correctly, you are trying to set field with setParams() which is wrong. setParams() only sets request parameters, that are then translated into URL params to let Solr know how to handle request itself. As far as I know, this way you cannot set fields yourself. Instead, /update/extract handler will try to extract contents by file’s MIME type, find hints about document attributes and use them as fields (note that Solr uses Tika library to extract document contents). So, if you really want to use /update/extract handler, try to follow this example without altering lines corresponding to request params and check what fields where generated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm able to upload JPG files, but not PNG files. The PNG image is
Users will be able to upload images and the name will be changed so
I need the user to be able to upload multiple files to my server,
I want users to be able to upload files via FTP to my site
I have the API connected and am able to upload tracks, but I haven't
I have a View in which the user is able to upload a file
I am able to have my application upload files via FTP using the FTPClient
I want to have users be able to upload .pdf and images and restrict
I'm developing a shopping system where shopmanager should be able to upload files to
My application allows user to upload pdf files and store them on the webserver

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.