我涉足解決方案,但無法找到一種方法來調整我的需求。SOLR/LUCENE專家,請幫我設計一個簡單的關鍵字從PDF索引搜索?
我有什麼:
一堆PDF文件。 一組關鍵字。
我想實現:
指數PDF文件(solrcell - 完成) 搜索一個關鍵字(工作正常) 定製輸出吐出PDF文件的名稱,一個摘錄發生關鍵字(無線索/想法如何)
嘗試操縱ResponseHandler/Schema.xml/Solrconfig.xml無濟於事。
Lucene/solr專家,你認爲我想實現的是可能的嗎?
我把我現有的代碼在GitHub上@https://github.com/ThinkCode/solr_search(其中大部分是稍作修改的字段(所有內容都存儲在一個內容字段)Solr的默認實例
schema.xml中存在顯着的變化:
Schema.xml的:
<solrQueryParser defaultOperator="AND"/>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="content" type="text_general" indexed="true" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="*" type="string" indexed="true" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
<solrQueryParser defaultOperator="AND"/>
<copyField source="*" dest="content"/>
電流輸出:
(查詢) http://localhost:8983/solr/select/?q=Java+Servlet&version=2.2&start=0&rows=10&indent=on
<response><lst name="responseHeader"><int name="status">0</int><int name="QTime">13</int><lst name="params"><str name="indent">on</str><str name="start">0</str><str name="q">Java Servlet</str><str name="version">2.2</str><str name="rows">10</str></lst></lst>
<result name="response" numFound="1" start="0"><doc><arr name="content_type"><str>application/pdf</str></arr><str name="id">tutorial.pdf</str><str name="subject">Solr</str><arr name="title"><str>Solr tutorial</str></arr></doc></result></response>
我所尋找的是 '其中的關鍵字,發現提取片段(線)'。
在提供的查詢中,我搜索'Java Servlet'並返回文檔。我對上下文'Solr可以在您選擇的任何Java Servlet容器中運行'感興趣,並將在輸出xml中返回。
是的,這是可能的。你可以發佈你到目前爲止,或者具體地遇到麻煩的地方嗎? –
我把代碼放在github上@ https://github.com/ThinkCode/solr_search,模式文件在https://github.com/ThinkCode/solr_search/blob/master/apachesolr330/example/solr/conf/schema .xml – ThinkCode
我的意思不是粗魯,但你必須比這更具體......否則它是一個「PLZ給我免費的codez /我的工作」類問題,這不是問題歡迎在stackoverflow。 –