lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syedfa <fayyazud...@gmail.com>
Subject Need help with XML Query Parser for search form
Date Thu, 31 Dec 2009 04:08:43 GMT

Dear fellow Java developers:

I am setting up an advanced search page that is very similar to google's and
yahoo's.  I have four text fields with the following labels:

                  With all of the words:
                With the exact phrase:
 With at least on one of the words:
                     Without the words:


In the XML Query parser example in Lucene 3.0, I set up the demo
application, which has a single text field that takes user input.  Looking
at the example application, I believe that the XSL code to reflect the query
for the first text field would look like this:

	<!--My example  -->
	<xsl:if test="allWords">
		<Clause occurs="must">
			<UserQuery fieldName="allWords"><xsl:value-of
select="allWords"/></UserQuery>
		</Clause>
	</xsl:if>

However, I am not sure how to construct the XSL blocks for the other three
text fields.  I am guessing that for the last text field, it would be:

	<!-- My Example -->
	<xsl:if test="withoutWords">
		<Clause occurs="mustnot">
			<UserQuery fieldName="withoutWords"><xsl:value-of
select="withoutWords"/></UserQuery>
		</Clause>
	</xsl:if>

Is this correct?  If not, what should it be?  For the middle two text
fields, how would I construct my XSL structure?  

Another question I have is the value, "should" for the "clause" attribute. 
What does this mean exactly, and when is it supposed to be used?  I have
read the documentation in the source package, and I am still unclear, so if
someone could elaborate further, I would greatly appreciate it.

Thanks in advance to all who reply.

Sincerely;
Fayyaz
-- 
View this message in context: http://old.nabble.com/Need-help-with-XML-Query-Parser-for-search-form-tp26975248p26975248.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message