Re: Finding All?

2004-08-13 Thread Erik Hatcher
On Aug 13, 2004, at 4:01 PM, [EMAIL PROTECTED] wrote:
A ranged query that covers the full range does the same thing.
Of course it is also inefficient with term generation:  myField[a TO z]
Note that this won't work if you have more than 1024 matching terms, 
which is a quite likely scenario.  The special "all" field trick is a 
nice option.

Another suggestion is to simply make a special case for an "all" query 
and use IndexReader to walk the documents in the index directly.

Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Finding All?

2004-08-13 Thread wallen
A ranged query that covers the full range does the same thing.  

Of course it is also inefficient with term generation:  myField[a TO z]

-Original Message-
From: Patrick Burleson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 3:58 PM
To: Lucene Users List
Subject: Re: Finding All?


That is a very interesting idea. I might give that a shot. 

Thanks,
Patrick

On Fri, 13 Aug 2004 15:36:11 -0400, Tate Avery <[EMAIL PROTECTED]>
wrote:
> 
> I had to do this once and I put a field called "all" with a value of
"true" for every document.
> 
> _doc.addField(Field.Keyword("all", "true"));
> 
> Then, if there was an empty query, I would substitute it for the query
"all:true".  And, of course, every doc would match this.
> 
> There might be a MUCH more elegant solution, but this certainly worked for
me and was quite easy to incorporate.  And, it appears to order the
documents by the order in which they were indexed.
> 
> T
> 
> p.s. You can probably do something using IndexReader directly... but the
nice thing about this approach is that you are still just using a simple
query.
> 
> 
> 
> -Original Message-
> From: Patrick Burleson [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 3:25 PM
> To: Lucene Users List
> Subject: Finding All?
> 
> Is there a way for lucene to find all documents? Say if I have a
> search input and someone puts  nothing in I want to go ahead and
> return everything. Passing "*" to QueryParser was not pretty.
> 
> Thanks,
> Patrick
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finding All?

2004-08-13 Thread Patrick Burleson
That is a very interesting idea. I might give that a shot. 

Thanks,
Patrick

On Fri, 13 Aug 2004 15:36:11 -0400, Tate Avery <[EMAIL PROTECTED]> wrote:
> 
> I had to do this once and I put a field called "all" with a value of "true" for 
> every document.
> 
> _doc.addField(Field.Keyword("all", "true"));
> 
> Then, if there was an empty query, I would substitute it for the query "all:true".  
> And, of course, every doc would match this.
> 
> There might be a MUCH more elegant solution, but this certainly worked for me and 
> was quite easy to incorporate.  And, it appears to order the documents by the order 
> in which they were indexed.
> 
> T
> 
> p.s. You can probably do something using IndexReader directly... but the nice thing 
> about this approach is that you are still just using a simple query.
> 
> 
> 
> -Original Message-
> From: Patrick Burleson [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 3:25 PM
> To: Lucene Users List
> Subject: Finding All?
> 
> Is there a way for lucene to find all documents? Say if I have a
> search input and someone puts  nothing in I want to go ahead and
> return everything. Passing "*" to QueryParser was not pretty.
> 
> Thanks,
> Patrick
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Finding All?

2004-08-13 Thread Tate Avery

I had to do this once and I put a field called "all" with a value of "true" for every 
document.

_doc.addField(Field.Keyword("all", "true"));

Then, if there was an empty query, I would substitute it for the query "all:true".  
And, of course, every doc would match this.

There might be a MUCH more elegant solution, but this certainly worked for me and was 
quite easy to incorporate.  And, it appears to order the documents by the order in 
which they were indexed.

T

p.s. You can probably do something using IndexReader directly... but the nice thing 
about this approach is that you are still just using a simple query.

-Original Message-
From: Patrick Burleson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 3:25 PM
To: Lucene Users List
Subject: Finding All?


Is there a way for lucene to find all documents? Say if I have a
search input and someone puts  nothing in I want to go ahead and
return everything. Passing "*" to QueryParser was not pretty.

Thanks,
Patrick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Finding All?

2004-08-13 Thread Patrick Burleson
Is there a way for lucene to find all documents? Say if I have a
search input and someone puts  nothing in I want to go ahead and
return everything. Passing "*" to QueryParser was not pretty.

Thanks,
Patrick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: boost keywords

2004-08-13 Thread Stephane James Vaucher
Other indexing strategies:

- AFAIK, you could probably cheat by multiplying the number of tokens in
headers thus affecting the scoring.

For example:
hello world  foo bar 
content -> hello world hello world foo bar

This is not very tweekable though.

- As Tate suggests, you can also use multiple fields and apply your search
on all of them:

hello world  foo bar 
content-> hello world foo bar
headers-> hello world

or even
hello world  foo bar 
content-> hello world foo bar
header1-> hello world
header2-> foo bar

The result of this is that you can fine-grained control over different
fields. At this point, you can boost at indexing or at search time. I
personnaly opt for search time because it is more open for tweeking as
oposed to reindexing everything whenever you want to change a boost
factor.

As for the complexities that Tate mentions for query parsing, he's right
that it's a pain when using the built-in query parser, but you can always
use the api directly to build whatever queries you need.

HTH,
sv

On Fri, 13 Aug 2004, Tate Avery wrote:

>
> Well, as far as I know you can boost 3 different things:
>
> - Field
> - Document
> - Query
>
> So, I think you need to craft a solution using one of those.
>
> Here are some possibilities for each:
>
> 1) Field
>   - make a keyword field which is alongside your content field
>   - boost your keyword field during indexing
>   - expand user queries to search 'content' and 'keywords'
>
> 2) Document
>   - I don't really think this one helps you in anyway
>
> 3) Query
>   - Scan a user query and selectively boost words that are known keywords
>   - This requires a keyword list and is not really scalable
>
> That is all that comes to mind, at first glance.  So, IMO, the winner IS #1.
>
> For example:
>
>   Field _headline = Field.Text("headline", "...");
>   _headline.setBoost(3);
>
>   Field _content = Field.Text("content", "...");
>
>   _document.addField(_headline);
>   _document.addField(_content);
>
>
> But, the tricky part is modifying queries to use both fields.  If a user
> enters "virus", it is easy (i.e. "content:(virus) OR headline:(virus)").
> But, it quickly gets more complex with more complex queries (especially
> boolean queries with AND and such ... you probably would need something
> roughly like this:  "a AND b" = "content:(a AND b) OR headline:(a AND b)
> OR (content:a AND headline:b) OR (headline:a AND content:b) and so on).
>
> That's my 2 cents.
>
> T
>
>
>
> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Leos Literak
> Sent: Friday, August 13, 2004 8:52 AM
> To: [EMAIL PROTECTED]
> Subject: Re: boost keywords
>
>
> Gerard Sychay napsal(a):
> > Well, there is always the Lucene wiki. There's not a patterns page per
> > se, but you could start one..
>
> of course I could. If I had something to add :-)
>
> but back to my issue. no reaction? So much people using
> Lucene and no one knows? I would be gratefull for any
> advice. Thanks
>
> Leos
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Searching Query !!!

2004-08-13 Thread Otis Gospodnetic
You need to keep a list of common words (aka stop words) somewhere. 
Then you can tokenize your input query, and check each token (each
query word) against your list.  You should probably use the same list
of stop/common words as the one that you are likely feeding into your
Analyzer at index and search time.

Otis

--- "Natarajan.T" <[EMAIL PROTECTED]> wrote:

> FYI,
>  
>  User enter the search query is like "What is java" 
>  
>  Here "is" a common word  how can I find out common words.
>  
>  I need the result like 
>  
>  "is" a common word and not include your search.
>  
>  
>  
> Thanks,
> Natarajan.
>  
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Searching Query !!!

2004-08-13 Thread Natarajan.T
FYI,
 
 User enter the search query is like "What is java" 
 
 Here "is" a common word  how can I find out common words.
 
 I need the result like 
 
 "is" a common word and not include your search.
 
 
 
Thanks,
Natarajan.
 


Re: Rename but not reindex

2004-08-13 Thread Erik Hatcher
You have to re-index.  Updating is not currently possible, at least not 
without really low-level hacks.

Erik
On Aug 13, 2004, at 8:23 AM, Demetrio Zenti wrote:
I apologise if it's a stupid question...
I index Document objects having 2 fields:
 - 1° representing file name. It's code is
   Field fieldPath = new Field("FIELD_FILENAME", filename, true, false,
false);
 - 2° representing body of this file
   Field fieldSize = new Field("FIELD_CONTENT", filebody, false, true,
true);
I've indexed all documents of a folder, let's say C:\tmp, and of its
subfolders.
Now I rename C:\tmp into C:\temp, and I want to update index, but
I don't want to reindex all documents, because sometimes it's much
expensive.
Is there any way to update a field of a Document (in this case
"FIELD_FILENAME") without reindexing?
Thanks
   Demetrio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Rename but not reindex

2004-08-13 Thread Otis Gospodnetic
No, just delete the Doc and re-add it.

Otis

--- Demetrio Zenti <[EMAIL PROTECTED]> wrote:

> I apologise if it's a stupid question...
> 
> I index Document objects having 2 fields:
>  - 1° representing file name. It's code is
>Field fieldPath = new Field("FIELD_FILENAME", filename, true,
> false,
> false);
> 
>  - 2° representing body of this file
>Field fieldSize = new Field("FIELD_CONTENT", filebody, false,
> true,
> true);
> 
> 
> I've indexed all documents of a folder, let's say C:\tmp, and of its
> subfolders.
> Now I rename C:\tmp into C:\temp, and I want to update index, but
> I don't want to reindex all documents, because sometimes it's much
> expensive.
> 
> Is there any way to update a field of a Document (in this case
> "FIELD_FILENAME") without reindexing?
> 
> Thanks
> 
>Demetrio
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: boost keywords

2004-08-13 Thread Tate Avery

Well, as far as I know you can boost 3 different things:

- Field
- Document
- Query

So, I think you need to craft a solution using one of those.

Here are some possibilities for each:

1) Field
- make a keyword field which is alongside your content field
- boost your keyword field during indexing
- expand user queries to search 'content' and 'keywords'

2) Document
- I don't really think this one helps you in anyway

3) Query
- Scan a user query and selectively boost words that are known keywords
- This requires a keyword list and is not really scalable

That is all that comes to mind, at first glance.  So, IMO, the winner IS #1.

For example:

Field _headline = Field.Text("headline", "...");
_headline.setBoost(3);

Field _content = Field.Text("content", "...");

_document.addField(_headline);
_document.addField(_content);


But, the tricky part is modifying queries to use both fields.  If a user enters 
"virus", it is easy (i.e. "content:(virus) OR headline:(virus)").  But, it quickly 
gets more complex with more complex queries (especially boolean queries with AND and 
such ... you probably would need something roughly like this:  "a AND b" = "content:(a 
AND b) OR headline:(a AND b) OR (content:a AND headline:b) OR (headline:a AND 
content:b) and so on).

That's my 2 cents.

T



-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Leos Literak
Sent: Friday, August 13, 2004 8:52 AM
To: [EMAIL PROTECTED]
Subject: Re: boost keywords


Gerard Sychay napsal(a):
> Well, there is always the Lucene wiki. There's not a patterns page per
> se, but you could start one..

of course I could. If I had something to add :-)

but back to my issue. no reaction? So much people using
Lucene and no one knows? I would be gratefull for any
advice. Thanks

Leos


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: boost keywords

2004-08-13 Thread Leos Literak
Gerard Sychay napsal(a):
Well, there is always the Lucene wiki. There's not a patterns page per
se, but you could start one..
of course I could. If I had something to add :-)
but back to my issue. no reaction? So much people using
Lucene and no one knows? I would be gratefull for any
advice. Thanks
Leos
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: MultiSearcher to Indexing.

2004-08-13 Thread Vladimir Yuryev
Thanks.
Vladimir.
On Fri, 13 Aug 2004 14:03:50 +0200
 [EMAIL PROTECTED] wrote:
Well, actually we use a nice piece of hardware with a lot of memory 
and 2
cpu under linux.

As front-end we use coldfusion application.  Seems to be ok, but we 
have
not  tested on huge load yet. Let You know if smth. gettig wrong.

Regards,
J.

  
   
 "Vladimir Yuryev" 
  
   
 <[EMAIL PROTECTED]To:   "Lucene 
Users List" <[EMAIL PROTECTED]> 

 ru>  cc: 
  

  Subject:  Re: 
MultiSearcher to Indexing. 
  
 13.08.2004 13:06 
  

 Please respond toCategory: 
 |-| 
   
 "Lucene Users| ( ) 
Action needed   | 
 List"| ( ) 
Decision needed | 
  | ( ) 
General Information | 
  |-| 
   
  
   
  
   


Hi Joel,
Parallel method requests a lot of memories, but MultiSearcher 
requires
slightly less memory.
Tomcat at the large loading gives out a system mistake.
If you have other experience of work that please tell me.

Regards,
Vladimir.
On Fri, 13 Aug 2004 12:22:34 +0200
 [EMAIL PROTECTED] wrote:
Hi Vladimir,
Can You please explain me what's the benefit of this approach and why
_pickles_?
I f I understand correctly the ?-n was how to make query run
paralelly on
multi-index. Is ParalelMultiSearcher not for this?
Regards,
Joel


 "Vladimir Yuryev"
 <[EMAIL PROTECTED]To:   "Lucene
Users List" <[EMAIL PROTECTED]>
 ru>  cc:
  Subject:  Re:
MultiSearcher to Indexing.
 13.08.2004 06:45
 Please respond toCategory:
 |-|
 "Lucene Users| ( )
Action needed   |
 List"| ( )
Decision needed |
  | ( )
General Information |
|-|




Natarajan,
MultiSeacher - it is well, but this a way have pickles.
Example, but it is not sample:
public Query combine(Query[] queries) throws IOException {
if (expandedQueries.length < 2) {
return queries[0];
}
Query[] combined = new Query[2];
combined[0] = new BooleanQuery();
BooleanQuery.setMaxClauseCount(1);
for (int i = 0; i < queries.length; i++) {
combined[1] = queries[i];
if (queries[i] instanceof BooleanQuery ||
queries[i] instanceof MultiTermQuery ||
queries[i] instanceof PrefixQuery ||
queries[i] instanceof RangeQuery) {
combined[0] = Query.mergeBooleanQueries(combined);
} else if (queries[i] instanceof PhraseQuery) {
Term[] queryTerms =
((PhraseQuery)queries[i]).getTerms();
for (int j = 0; j < queryTerms.length; j++) {
TermQuery q = new TermQuery(queryTerms[j]);
((BooleanQuery)combined[0]).add(q, true, false);
}
} else ((BooleanQuery)combined[0]).add(queries[i], true,
false);
}
return combined[0];
}
...
Searcher[] searchers = new IndexSearcher[indexName.length];
for(int i=0;i
Best regards,
Vladimir.


On Thu, 12 Aug 2004 20:51:13 +0530
 "Natarajan.T" <[EMAIL PROTECTED]> wrote:
Thanks for your response.
Ok I can understand the concept . if you have any sample code pls
sent it to me.
You have any idea about Parallel Searcher pls share to me.
-Original Message-
From: Terence Lai [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 12, 2004 8:40 PM
To: Lucene Users List
Subject: RE: MultiSearcher to Indexing.
This is how I do it:
IndexSearcher[] is

Rename but not reindex

2004-08-13 Thread Demetrio Zenti
I apologise if it's a stupid question...

I index Document objects having 2 fields:
 - 1° representing file name. It's code is
   Field fieldPath = new Field("FIELD_FILENAME", filename, true, false,
false);

 - 2° representing body of this file
   Field fieldSize = new Field("FIELD_CONTENT", filebody, false, true,
true);


I've indexed all documents of a folder, let's say C:\tmp, and of its
subfolders.
Now I rename C:\tmp into C:\temp, and I want to update index, but
I don't want to reindex all documents, because sometimes it's much
expensive.

Is there any way to update a field of a Document (in this case
"FIELD_FILENAME") without reindexing?

Thanks

   Demetrio



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: MultiSearcher to Indexing.

2004-08-13 Thread iouli . golovatyi

Well, actually we use a nice piece of hardware with a lot of memory and 2
cpu under linux.

As front-end we use coldfusion application.  Seems to be ok, but we have
not  tested on huge load yet. Let You know if smth. gettig wrong.

Regards,
J.




   

  "Vladimir Yuryev"

  <[EMAIL PROTECTED]To:   "Lucene Users List" <[EMAIL 
PROTECTED]>  
  ru>  cc: 

   Subject:  Re: MultiSearcher to 
Indexing.
  13.08.2004 13:06 

  Please respond toCategory:   
|-| 
  "Lucene Users| ( ) Action needed 
  | 
  List"| ( ) Decision needed   
  | 
   | ( ) General 
Information | 
   
|-| 
   

   





Hi Joel,

Parallel method requests a lot of memories, but MultiSearcher requires
slightly less memory.
Tomcat at the large loading gives out a system mistake.
If you have other experience of work that please tell me.

Regards,
Vladimir.

On Fri, 13 Aug 2004 12:22:34 +0200
  [EMAIL PROTECTED] wrote:
>
>Hi Vladimir,
>
>Can You please explain me what's the benefit of this approach and why
>_pickles_?
>
>I f I understand correctly the ?-n was how to make query run
>paralelly on
>multi-index. Is ParalelMultiSearcher not for this?
>
>Regards,
>Joel
>
>
>
>
>
>  "Vladimir Yuryev"
>
>
>  <[EMAIL PROTECTED]To:   "Lucene
>Users List" <[EMAIL PROTECTED]>
>
>  ru>  cc:
>
>
>   Subject:  Re:
>MultiSearcher to Indexing.
>
>  13.08.2004 06:45
>
>
>  Please respond toCategory:
>  |-|
>
>  "Lucene Users| ( )
>Action needed   |
>  List"| ( )
>Decision needed |
>   | ( )
>General Information |
>
|-|
>
>
>
>
>
>
>
>
>
>Natarajan,
>
>MultiSeacher - it is well, but this a way have pickles.
>
>Example, but it is not sample:
>
>public Query combine(Query[] queries) throws IOException {
> if (expandedQueries.length < 2) {
> return queries[0];
> }
> Query[] combined = new Query[2];
> combined[0] = new BooleanQuery();
> BooleanQuery.setMaxClauseCount(1);
> for (int i = 0; i < queries.length; i++) {
> combined[1] = queries[i];
> if (queries[i] instanceof BooleanQuery ||
> queries[i] instanceof MultiTermQuery ||
> queries[i] instanceof PrefixQuery ||
> queries[i] instanceof RangeQuery) {
> combined[0] = Query.mergeBooleanQueries(combined);
> } else if (queries[i] instanceof PhraseQuery) {
> Term[] queryTerms =
>((PhraseQuery)queries[i]).getTerms();
> for (int j = 0; j < queryTerms.length; j++) {
> TermQuery q = new TermQuery(queryTerms[j]);
> ((BooleanQuery)combined[0]).add(q, true, false);
> }
> } else ((BooleanQuery)combined[0]).add(queries[i], true,
>false);
> }
> return combined[0];
>}
>
>...
> Searcher[] searchers = new IndexSearcher[indexName.length];
> for(int i=0;i searchers[i] = new IndexSearcher(indexName[i]);
> }
> MultiSearcher multiSearcher=new MultiSearcher(searchers);
> QueryParser qp = new QueryParser(FIELD_CONTENTS, analyzer);
> query = QueryParser.parse(queryString, FIELD_CONTENTS,
>analyzer);
> hits = multiSearcher.search(query);
> IndexReader reader[] = new IndexReader[indexName.length];
> Query[] exp

Re: MultiSearcher to Indexing.

2004-08-13 Thread Vladimir Yuryev
Hi Joel,
Parallel method requests a lot of memories, but MultiSearcher requires 
slightly less memory.
Tomcat at the large loading gives out a system mistake.
If you have other experience of work that please tell me.

Regards,
Vladimir.
On Fri, 13 Aug 2004 12:22:34 +0200
 [EMAIL PROTECTED] wrote:
Hi Vladimir,
Can You please explain me what's the benefit of this approach and why
_pickles_?
I f I understand correctly the ?-n was how to make query run 
paralelly on
multi-index. Is ParalelMultiSearcher not for this?

Regards,
Joel

  
   
 "Vladimir Yuryev" 
  
   
 <[EMAIL PROTECTED]To:   "Lucene 
Users List" <[EMAIL PROTECTED]> 

 ru>  cc: 
  

  Subject:  Re: 
MultiSearcher to Indexing. 
  
 13.08.2004 06:45 
  

 Please respond toCategory: 
 |-| 
   
 "Lucene Users| ( ) 
Action needed   | 
 List"| ( ) 
Decision needed | 
  | ( ) 
General Information | 
  |-| 
   
  
   
  
   


Natarajan,
MultiSeacher - it is well, but this a way have pickles.
Example, but it is not sample:
public Query combine(Query[] queries) throws IOException {
if (expandedQueries.length < 2) {
return queries[0];
}
Query[] combined = new Query[2];
combined[0] = new BooleanQuery();
BooleanQuery.setMaxClauseCount(1);
for (int i = 0; i < queries.length; i++) {
combined[1] = queries[i];
if (queries[i] instanceof BooleanQuery ||
queries[i] instanceof MultiTermQuery ||
queries[i] instanceof PrefixQuery ||
queries[i] instanceof RangeQuery) {
combined[0] = Query.mergeBooleanQueries(combined);
} else if (queries[i] instanceof PhraseQuery) {
Term[] queryTerms = 
((PhraseQuery)queries[i]).getTerms();
for (int j = 0; j < queryTerms.length; j++) {
TermQuery q = new TermQuery(queryTerms[j]);
((BooleanQuery)combined[0]).add(q, true, false);
}
} else ((BooleanQuery)combined[0]).add(queries[i], true,
false);
}
return combined[0];
}

...
Searcher[] searchers = new IndexSearcher[indexName.length];
for(int i=0;i
searchers[i] = new IndexSearcher(indexName[i]);
}
MultiSearcher multiSearcher=new MultiSearcher(searchers);
QueryParser qp = new QueryParser(FIELD_CONTENTS, analyzer);
query = QueryParser.parse(queryString, FIELD_CONTENTS, 
analyzer);
hits = multiSearcher.search(query);
IndexReader reader[] = new IndexReader[indexName.length];
Query[] expandedQueries=new Query[indexName.length];
for(int i=0;i
IndexReader.open(indexName[i]);
expandedQueries[i]=query.rewrite(reader[i]);
}
query=combine(expandedQueries);
...

Best regards,
Vladimir.


On Thu, 12 Aug 2004 20:51:13 +0530
 "Natarajan.T" <[EMAIL PROTECTED]> wrote:
Thanks for your response.
Ok I can understand the concept . if you have any sample code pls
sent it to me.
You have any idea about Parallel Searcher pls share to me.
-Original Message-
From: Terence Lai [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 12, 2004 8:40 PM
To: Lucene Users List
Subject: RE: MultiSearcher to Indexing.
This is how I do it:
IndexSearcher[] is = new IndexSearcher[2];
is[0] = new IndexSearcher(IndexDir1); // first index folder
is[1] = new IndexSearcher(IndexDir2); // second index folder
MultiSearcher searcher = new MultiSearcher(is);
searcher.search(query);
I think that the MulitSearcher is only doing sequential search.
Alternately, you can use ParallelMultiSearcher which allows you to do
the search in parallel.
Hope this helps,
Terence

FYI
I have an Indexing files in different folders, in t

Re: MultiSearcher to Indexing.

2004-08-13 Thread iouli . golovatyi

Hi Vladimir,

Can You please explain me what's the benefit of this approach and why
_pickles_?

I f I understand correctly the ?-n was how to make query run paralelly on
multi-index. Is ParalelMultiSearcher not for this?

Regards,
Joel



   

  "Vladimir Yuryev"

  <[EMAIL PROTECTED]To:   "Lucene Users List" <[EMAIL 
PROTECTED]>  
  ru>  cc: 

   Subject:  Re: MultiSearcher to 
Indexing.
  13.08.2004 06:45 

  Please respond toCategory:   
|-| 
  "Lucene Users| ( ) Action needed 
  | 
  List"| ( ) Decision needed   
  | 
   | ( ) General 
Information | 
   
|-| 
   

   





Natarajan,

MultiSeacher - it is well, but this a way have pickles.

Example, but it is not sample:

public Query combine(Query[] queries) throws IOException {
 if (expandedQueries.length < 2) {
 return queries[0];
 }
 Query[] combined = new Query[2];
 combined[0] = new BooleanQuery();
 BooleanQuery.setMaxClauseCount(1);
 for (int i = 0; i < queries.length; i++) {
 combined[1] = queries[i];
 if (queries[i] instanceof BooleanQuery ||
 queries[i] instanceof MultiTermQuery ||
 queries[i] instanceof PrefixQuery ||
 queries[i] instanceof RangeQuery) {
 combined[0] = Query.mergeBooleanQueries(combined);
 } else if (queries[i] instanceof PhraseQuery) {
 Term[] queryTerms = ((PhraseQuery)queries[i]).getTerms();
 for (int j = 0; j < queryTerms.length; j++) {
 TermQuery q = new TermQuery(queryTerms[j]);
 ((BooleanQuery)combined[0]).add(q, true, false);
 }
 } else ((BooleanQuery)combined[0]).add(queries[i], true,
false);
 }
 return combined[0];
}

...
 Searcher[] searchers = new IndexSearcher[indexName.length];
 for(int i=0;i wrote:
>Thanks for your response.
>Ok I can understand the concept . if you have any sample code pls
>sent it to me.
>
>You have any idea about Parallel Searcher pls share to me.
>
>-Original Message-
>From: Terence Lai [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 12, 2004 8:40 PM
>To: Lucene Users List
>Subject: RE: MultiSearcher to Indexing.
>
>This is how I do it:
>
>IndexSearcher[] is = new IndexSearcher[2];
>
>is[0] = new IndexSearcher(IndexDir1); // first index folder
>is[1] = new IndexSearcher(IndexDir2); // second index folder
>
>MultiSearcher searcher = new MultiSearcher(is);
>
>searcher.search(query);
>
>I think that the MulitSearcher is only doing sequential search.
>Alternately, you can use ParallelMultiSearcher which allows you to do
>the search in parallel.
>
>Hope this helps,
>Terence
>
>
>
>> FYI
>>
>> I have an Indexing files in different folders, in this time how can
>>I
>> doing  the Searching process using MultiSearcher.
>>
>> Thanks,
>> Natarajan.
>>
>>
>>
>>
>>
>>
>
>
>
>
>--
>Get your free email account from http://www.trekspace.com
>  Your Internet Virtual Desktop!
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








HitCollector

2004-08-13 Thread Karthik N S

Hello

Please somebody explain me how to use  the HitCollector on a simple
Searcher.search(query) to obtain  score range between 1.0f and 0.02456f.


Thx in advance



  WITH WARM REGARDS
  HAVE A NICE DAY
  [ N.S.KARTHIK]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]