lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Øie <k...@gan.no>
Subject Re: Search on XML files
Date Mon, 13 May 2002 14:34:51 GMT
> +(Australia AND tagname:country) AND +(20020415 AND tagname:date)

AND and + does the same, so:

	+(Australia AND tagname:country) +(20020415 AND tagname:date)

should return a set with documents everything are mached, basicly the same as:

	Australia AND tagname:country AND 20020415 AND tagname:date


> 1. What the query string suppose to be if I want to get records which
> contain (Austalia and 20020415) or (HongKong and 20020315)?

	(Austalia AND 20020415) (HongKong AND 20020315)


> 2. What the query string suppose to be if I want to get records which
> contain (Australia and 20020415) and (not (HongKong and 20020315))?

	+(Austalia AND 20020415) -(HongKong AND 20020315)


> Since I am a newbie on Lucene, I am wonder whether I can use filter to
> restricts the search results? In my case, I need to retrieve all the news
> between a date range (for example, 20020102 to 20020330). In addition, the
> result should only contains those news that have been subscribed  . Should
> I use filter to filter out the unsubscribed news? Or I should make up a
> query string to include those subscribed news? Which approach is better in
> terms of performance?

for the date you should use the Field.Date field type, but i don't think here 
is a shortcut to also filter with subscribers without doing something weird 
like adding say 3000 years to all dates that has been subscribed and then 
search for dates between 30020102 -> 30020330....

if you don't think this is a good idea (chances are that your system is not 
going to be used for more than a millenia) you can just use a SUBSCRIBED 
field to the index and seach for things that maches date AND subscribe=???.
lucene is quite fast even for large indexes so it should performe good 
anyhow....


happy hacking!


mvh karl øie


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message