jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomasg <thomasgascoi...@hotmail.com>
Subject Re: Restricting xpath query to document text
Date Mon, 15 May 2006 11:31:21 GMT

Hi,

I have implemented your suggestions with some success. The only change I
made to addBinaryValue() was to add the following code to the end of the
method, the original code remains:

                Reader fullTextReader = (Reader)
fields.get(FieldNames.FULLTEXT);
                if (fullTextReader != null)
                {
                	try
                	{                   
                	    String text = readerToString(fullTextReader);
                	    addStringValue(doc, fieldName, text);
                	}
                	catch (IOException e)
                	{
                		//TODO Logging etc
                		e.printStackTrace();
                	}
                }

When you said it got a bit nasty were you refering to the spooling from
Reader to String (method readerToString)? It seems that you need to remove
nasty parts of the returned string such as "\r\n" or the searches don't
work. Doing this I have success with smaller documents but larger ones are
not all working yet. Maybe there are more mallicious characters to remove?

Its cool that I am now getting results when searching with jcr:like:
jcr:like(@jcr:data, '%are not intended to be%')

Cheers, Thomas
--
View this message in context: http://www.nabble.com/Restricting-xpath-query-to-document-text-t1512215.html#a4390389
Sent from the Jackrabbit - Dev forum at Nabble.com.


Mime
View raw message