You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by stefan81 <st...@process-relations.com> on 2007/09/10 11:32:52 UTC

Problem with fulltext search

Hi all,

although I have read many threads I cannot figure out why my fulltext search
does not work. Here is my repository.xml:

<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">


</SearchIndex>

When I startup JBoss I cannot really see that the extractors are loaded. But
if I add for example org.apache.jackrabbit.extractor.bla then I get an
exception during startup. So I think the extractors are loaded.

In my repository on the filesystem I have configured "workspace.xml" like
repository.xml containing the same text filters.

I have a file "hello.rtf" containing just the word "hello". I load the file
into the repository:

File file = new File("hello.rtf");

MimeTable mt = MimeTable.getDefaultTable();
String mimeType = mt.getContentTypeFor(file.getName()); // this is
application/rtf

Node fileNode = parentnode.addNode(file.getName(), "nt:file");
Node resNode = fileNode.addNode("jcr:content", "nt:resource");
resNode.setProperty("jcr:mimeType", mimeType);
resNode.setProperty("jcr:encoding", "");
resNode.setProperty("jcr:data", new FileInputStream(file));

Why doesn´t the following query provide any results?

Query q = qm.createQuery("//*[jcr:contains(.,'hello')] ", Query.XPATH);

Did I miss something? Has anybody help for me?
-- 
View this message in context: http://www.nabble.com/Problem-with-fulltext-search-tf4413382.html#a12589528
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Problem with fulltext search

Posted by stefan81 <st...@process-relations.com>.
Thank you,

it works now. The problem seemed to result from the problems with the office
2007 formats I mentioned in another thread. The problems occured when I
created my rtf-file with word 2007. When I deleted it and created a now one
with word pad the indexing worked fine.



Marcel Reutegger wrote:
> 
> can you please enable debug messages for the class 
> org.apache.jackrabbit.core.query.lucene.JackrabbitTextExtractor and re-run
> your 
> test?
> 
> the log file will then contain debug messages about the text extraction
> process.
> 
> regards
>   marcel
> 
> stefan81 wrote:
>> Hi all,
>> 
>> although I have read many threads I cannot figure out why my fulltext
>> search
>> does not work. Here is my repository.xml:
>> 
>> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>> 
>> 
>> </SearchIndex>
>> 
>> When I startup JBoss I cannot really see that the extractors are loaded.
>> But
>> if I add for example org.apache.jackrabbit.extractor.bla then I get an
>> exception during startup. So I think the extractors are loaded.
>> 
>> In my repository on the filesystem I have configured "workspace.xml" like
>> repository.xml containing the same text filters.
>> 
>> I have a file "hello.rtf" containing just the word "hello". I load the
>> file
>> into the repository:
>> 
>> File file = new File("hello.rtf");
>> 
>> MimeTable mt = MimeTable.getDefaultTable();
>> String mimeType = mt.getContentTypeFor(file.getName()); // this is
>> application/rtf
>> 
>> Node fileNode = parentnode.addNode(file.getName(), "nt:file");
>> Node resNode = fileNode.addNode("jcr:content", "nt:resource");
>> resNode.setProperty("jcr:mimeType", mimeType);
>> resNode.setProperty("jcr:encoding", "");
>> resNode.setProperty("jcr:data", new FileInputStream(file));
>> 
>> Why doesn´t the following query provide any results?
>> 
>> Query q = qm.createQuery("//*[jcr:contains(.,'hello')] ", Query.XPATH);
>> 
>> Did I miss something? Has anybody help for me?
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-fulltext-search-tf4413382.html#a12616029
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Problem with fulltext search

Posted by Marcel Reutegger <ma...@gmx.net>.
can you please enable debug messages for the class 
org.apache.jackrabbit.core.query.lucene.JackrabbitTextExtractor and re-run your 
test?

the log file will then contain debug messages about the text extraction process.

regards
  marcel

stefan81 wrote:
> Hi all,
> 
> although I have read many threads I cannot figure out why my fulltext search
> does not work. Here is my repository.xml:
> 
> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
> 
> 
> </SearchIndex>
> 
> When I startup JBoss I cannot really see that the extractors are loaded. But
> if I add for example org.apache.jackrabbit.extractor.bla then I get an
> exception during startup. So I think the extractors are loaded.
> 
> In my repository on the filesystem I have configured "workspace.xml" like
> repository.xml containing the same text filters.
> 
> I have a file "hello.rtf" containing just the word "hello". I load the file
> into the repository:
> 
> File file = new File("hello.rtf");
> 
> MimeTable mt = MimeTable.getDefaultTable();
> String mimeType = mt.getContentTypeFor(file.getName()); // this is
> application/rtf
> 
> Node fileNode = parentnode.addNode(file.getName(), "nt:file");
> Node resNode = fileNode.addNode("jcr:content", "nt:resource");
> resNode.setProperty("jcr:mimeType", mimeType);
> resNode.setProperty("jcr:encoding", "");
> resNode.setProperty("jcr:data", new FileInputStream(file));
> 
> Why doesn´t the following query provide any results?
> 
> Query q = qm.createQuery("//*[jcr:contains(.,'hello')] ", Query.XPATH);
> 
> Did I miss something? Has anybody help for me?


Re: Problem with fulltext search

Posted by stefan81 <st...@process-relations.com>.
Somehow some parts of my repository.xml are not displayed correctly in the
forum. I use the following text extractors in the repository.xml:

org.apache.jackrabbit.extractor.RTFTextExtractor
org.apache.jackrabbit.extractor.MsWordTextExtractor


-- 
View this message in context: http://www.nabble.com/Problem-with-fulltext-search-tf4413382.html#a12589757
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.