You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Morten Simonsen <mo...@owera.com> on 2007/03/05 11:07:31 UTC

SELECT * FROM Index-file

Hi

I'm about to convert from Lucene index-files into a MySQL (sorry about
that:) I thought I would run a "SELECT *" on the index-file, then read
through all the "rows" (hits?) and process each of them into my new
database. 

So I wrote this code: 

----
WildcardQuery query = new WildcardQuery(new Term("UnitID", "*"));
Hits hits = ism.searchUnits(query);
----

Then I receive "Something failed: org.apache.lucene.search.BooleanQuery
$TooManyClauses"

I tried to set 
BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE);
but then I ran out of memory, so this is clearly not a good solution. 

I have tried using several different fields as well, also fields which
has only a limited set of values (the field are then not unique in the
index-file).

Any suggestions?

Morten Simonsen

(And yes, I'm a newbie. Didn't find anything useful during my searches
on the Internet, mailing-lists or in the book, maybe because this is a
pretty infrequent thing to do?)







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


Re: SELECT * FROM Index-file

Posted by Morten Simonsen <mo...@owera.com>.
On Mon, 2007-03-05 at 07:52 -0500, Erick Erickson wrote:
> Why not just call IndexReader.document(idx) where idx ranges
> from 0 to IndexReader.maxDoc()? I believe if your index has some
> deleted documents you'll have to handle null returns though....

That was exactly what I was looking for. Thanks.

> Sorry to lose you to the dark side <G>...

:) You know, Darth Vader actually saved all of them in the end, so hope
is not lost entirely;)

Morten Simonsen

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


Re: SELECT * FROM Index-file

Posted by Ronnie Kolehmainen <ro...@ub.uu.se>.
Or MatchAllDocsQuery.

/Ronnie

Erick Erickson wrote:
> Why not just call IndexReader.document(idx) where idx ranges
> from 0 to IndexReader.maxDoc()? I believe if your index has some
> deleted documents you'll have to handle null returns though....
> 
> Sorry to lose you to the dark side <G>...
> 
> Best
> Erick
> 
> 
> On 3/5/07, Morten Simonsen <mo...@owera.com> wrote:
> 
>>
>> Hi
>>
>> I'm about to convert from Lucene index-files into a MySQL (sorry about
>> that:) I thought I would run a "SELECT *" on the index-file, then read
>> through all the "rows" (hits?) and process each of them into my new
>> database.
>>
>> So I wrote this code:
>>
>> ----
>> WildcardQuery query = new WildcardQuery(new Term("UnitID", "*"));
>> Hits hits = ism.searchUnits(query);
>> ----
>>
>> Then I receive "Something failed: org.apache.lucene.search.BooleanQuery
>> $TooManyClauses"
>>
>> I tried to set
>> BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE);
>> but then I ran out of memory, so this is clearly not a good solution.
>>
>> I have tried using several different fields as well, also fields which
>> has only a limited set of values (the field are then not unique in the
>> index-file).
>>
>> Any suggestions?
>>
>> Morten Simonsen
>>
>> (And yes, I'm a newbie. Didn't find anything useful during my searches
>> on the Internet, mailing-lists or in the book, maybe because this is a
>> pretty infrequent thing to do?)
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
> 

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


Re: SELECT * FROM Index-file

Posted by Erick Erickson <er...@gmail.com>.
Why not just call IndexReader.document(idx) where idx ranges
from 0 to IndexReader.maxDoc()? I believe if your index has some
deleted documents you'll have to handle null returns though....

Sorry to lose you to the dark side <G>...

Best
Erick


On 3/5/07, Morten Simonsen <mo...@owera.com> wrote:
>
> Hi
>
> I'm about to convert from Lucene index-files into a MySQL (sorry about
> that:) I thought I would run a "SELECT *" on the index-file, then read
> through all the "rows" (hits?) and process each of them into my new
> database.
>
> So I wrote this code:
>
> ----
> WildcardQuery query = new WildcardQuery(new Term("UnitID", "*"));
> Hits hits = ism.searchUnits(query);
> ----
>
> Then I receive "Something failed: org.apache.lucene.search.BooleanQuery
> $TooManyClauses"
>
> I tried to set
> BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE);
> but then I ran out of memory, so this is clearly not a good solution.
>
> I have tried using several different fields as well, also fields which
> has only a limited set of values (the field are then not unique in the
> index-file).
>
> Any suggestions?
>
> Morten Simonsen
>
> (And yes, I'm a newbie. Didn't find anything useful during my searches
> on the Internet, mailing-lists or in the book, maybe because this is a
> pretty infrequent thing to do?)
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>