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 Girish Pandit <pa...@gmail.com> on 2010/07/26 06:10:49 UTC

"SELECT" on a Rich Document to download/display content

Hi,

I indexed a word document, when I do select, it shows the file name. How 
can I display content? also if I add "hl=true", is this going to show me 
the line with the highlight from the word document?

I am using below URL to do select:

http://localhost:8983/solr/select/?q=Management

it shows Response like below:
<response>
<lst name="responseHeader"><int name="status">0</int><int 
name="QTime">1</int><lst name="params"><str 
name="q">Management</str></lst></lst><result name="response" 
numFound="1" start="0"><doc><str name="id">Mgmt.doc</str></doc></result>
</response>

Indexing was done with below Java code:

    public void SolrCellRequestDemo() throws IOException, 
SolrServerException {
            SolrServer server = new 
CommonsHttpSolrServer("http://localhost:8983/solr");
            ContentStreamUpdateRequest req = new 
ContentStreamUpdateRequest("/update/extract");
            req.addFile(new File("/Users/Girish/Development/Web 
Server/apache-solr-1.4.1/example/exampledocs/Mgmt.doc"));
            req.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
            req.setParam("literal.id", "Mgmt.doc");
            NamedList<Object> result = server.request(req);
            System.out.println("Result: " + result);
           
        }