You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by yannisc <ya...@gmail.com> on 2012/06/18 21:05:04 UTC

Problems with fulltext search on nt:binary

All,
I am reasonably new to jackrabbit. I have set up a schema where I can
successfully do full text search on properties of type PropertyType.STRING.
I am still not succeeding on finding nodes where I am storing as nt:file.

Here is how I form a query (which succeeds for STRING):
  String statement = "SELECT * FROM [nt:base] WHERE CONTAINS([nt:base].*,'"
+ fullTextSearch + "')";
  Query query = qm.createQuery(statement, Query.JCR_SQL2);

The way I am (currently, experimentally) creating the file nodes is:
      Node fileNode = parentNode.addNode(name, NodeType.NT_FILE);
      Node valueNode = fileNode.addNode(Property.JCR_CONTENT,
NodeType.NT_RESOURCE);
      valueNode.setProperty("jcr:mimeType", "text/plain");
      valueNode.setProperty("jcr:data", binValue);

I have experimented with various configuration settings including things
like in repository.xml:
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            
            
            
            
        </SearchIndex>
and in indexing_configuration.xml:
    <aggregate primaryType="nt:base">
        <include>nt:file</include>
        <include>nt:file/jcr:content/*</include>
        <include>nt:file/jcr:content/*/*</include>
    </aggregate>
but all to no avail.
Any help greatly appreciated. I am on jackrabbit 2.4.1
Thanks
--Yannis


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Problems-with-fulltext-search-on-nt-binary-tp4655486.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Problems with fulltext search on nt:file

Posted by yannisc <ya...@gmail.com>.
Some clarifications/corrections. I meant to say nt:file not nt:binary.

The configuration detail got lost:
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            
            
        </SearchIndex>

And just to be clear - when I populate STRING fields with test data and
search using:
   "SELECT * FROM [nt:base] as t WHERE CONTAINS(t.*,'" + fullTextSearch +
"')"

I find the nodes having the data in the STRING fields. But when the nodes
have a child node of type nt:file with the same data, the nodes are not
found. Googling about indicates that I may need to configure either tika or
search index but my attempts have so far failed. Any pointers to working
configurations would be appreciated.

Thanks again
--Yannis


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Problems-with-fulltext-search-on-nt-binary-tp4655486p4655489.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Problems with fulltext search on nt:binary

Posted by yannisc <ya...@gmail.com>.
Sorry. The sleep solution did not actually solve the problem. I still can't
find the nt:file nodes

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Problems-with-fulltext-search-on-nt-binary-tp4655486p4655491.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Problems with fulltext search on nt:binary

Posted by yannisc <ya...@gmail.com>.
I found the solution. A sleep between adding the data to the node and doing
the search solved the problem. I figured this out after seeing other posts
about indexing happening in a thread other than the thread used to
create/update data.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Problems-with-fulltext-search-on-nt-binary-tp4655486p4655490.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.