Hi everyone,
I use jackrabbit 2.1.0, and I'd like to do full text search in nodes that
hold documents (word, pdf.. and so on)
I wrote the following code, and the porblem is that it never returns
result! Although the documents are there and the query string which I
enter does exist in those documents. Don't know what did I miss or did
wrong!
Could it be because I didn't specify values for the columns and orderings?
Actually I don't know what are these!
When I use XPath (which is deprecated) it works fine.
Here is the JQOM code:
QueryManager queryManager =
session.getWorkspace().getQueryManager();
QueryObjectModelFactory qomf = queryManager.getQOMFactory();
ValueFactory vf = session.getValueFactory();
String selectorName = "fullTextSearchSelector";
Selector selector = qomf.selector("nt:resource", selectorName);
Constraint constraint = qomf.fullTextSearch(selectorName,
"jcr:data", qomf.literal(vf
.createValue("someText")));
QueryObjectModel queryObjectModel = qomf.createQuery(selector,
constraint, null,
null);
QueryResult result = queryObjectModel.execute();
RowIterator iter = result.getRows();
System.out.println("size: " + iter.getSize());
while (iter.hasNext()) {
Row row = iter.nextRow();
System.out.println("Row: " + row.toString());
}
Please, can any one tell me what could be wrong here? And if it's better
ot use SQL, so how?
Thank you in advance.