Why is the constructor of TopFieldDocs not public?

2009-02-23 Thread Cheolgoo Kang
I'm subclassing MultiSearcher and writing a customized searcher on my own.

The search( Weight, Filter, int, Sort ) method on MultiSearcher should
return TopFieldDocs, but I cannot instantiate one cause TopFieldDocs
constructor is declared as package-private. (TopFieldDocs itself is
public!)

Is there any reason the constructor of TopFieldDocs has no modifier declaration?

- Cheolgoo Kang

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



IndexWriter 2-phase commit usage

2009-02-23 Thread An Hong
I'm having trouble applying IndexWriter 2-phase commit to make a transaction 
involving two different indexes.  The scenario,

 1.  Open index1
 2.  Open index2
 3.  Make change1 to index1
 4.  Make change2 to index2
 5.  index1.prepareCommit() successfully flushes
 6.  index2.prepareCommit() successfully flushes
 7.  index1.commit() successfully (segmentN file written)
 8.  index2.commit()
If step 8 fails, how can I roll back step 7 w/o implementing my own undo logic? 
 I want to make change1 and change2 a single transaction.
Thanks,
An


Re: Upgrading an old index to 2.4 format

2009-02-23 Thread Michael McCandless


That is true.

Good question on converting an already optimized index... I haven't  
tested this, and it's somewhat roundabout, but you may be able to open  
an IndexWriter, then call setUseCompoundFile with the opposite of what  
your index presently has, run optimize, set that back, and run  
optimize again.  I think it should work.


You could also add and then delete a single doc, then call optimize.

Mike

An Hong wrote:



I've several existing indexes in 2.1 file format.  If these indexes  
have multiple segments and have not been optimized, a call to  
IndexWriter.optimize() should create a newly merged segment of the  
latest 2.4 file format.  Is this true?  And, is there a way to force  
a file format upgrade on a 2.1 index that's already in optimized  
state?

Thanks,
An




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



Re: IndexWriter.rollback() logic question

2009-02-23 Thread Michael McCandless


The javadoc is not right -- I just committed a fix.

rollback() discards all changes since the last commit, or since the  
IndexWriter was opened (if commit hasn't been called).


So in your case, doc1 is in the index but doc2 is not.

You can also call rollback() not having called prepareCommit().

Mike

An Hong wrote:

A question about IndexWriter.rollback() logic.  Its javadoc says  
that it "Close the IndexWriter without committing any of the changes  
that have occurred since it was opened."  So if I do

1.  Open  IndexWriter
2.  Add doc1
3.  Commit (successfully)
4.  Add doc2
5.  PrepareCommit()
6.  Rollback()

Is doc1 in the index?  If not, I wonder how come rollback() does not  
roll back to the last successful commit() state instead?

Thanks,
An




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



Upgrading an old index to 2.4 format

2009-02-23 Thread An Hong

I've several existing indexes in 2.1 file format.  If these indexes have 
multiple segments and have not been optimized, a call to IndexWriter.optimize() 
should create a newly merged segment of the latest 2.4 file format.  Is this 
true?  And, is there a way to force a file format upgrade on a 2.1 index that's 
already in optimized state?
Thanks,
An



IndexWriter.rollback() logic question

2009-02-23 Thread An Hong
A question about IndexWriter.rollback() logic.  Its javadoc says that it "Close 
the IndexWriter without committing any of the changes that have occurred since 
it was opened."  So if I do
1.  Open  IndexWriter
2.  Add doc1
3.  Commit (successfully)
4.  Add doc2
5.  PrepareCommit()
6.  Rollback()

Is doc1 in the index?  If not, I wonder how come rollback() does not roll back 
to the last successful commit() state instead?
Thanks,
An



Re: Phrase indexing and searching with Lucene

2009-02-23 Thread Chris Hostetter

: Subject: Phrase indexing and searching with Lucene
: References: <499be497.2060...@mapmyindia.com>
: <18248.30864...@web26005.mail.ukl.yahoo.com>

http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.
See Also:  http://en.wikipedia.org/wiki/Thread_hijacking





-Hoss


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



Field Normalisation in Query across two indexes

2009-02-23 Thread Dino Korah
Guys,

I have a question on normalisation.
I am using a prehistoric version of lucene; 2.0.0

Context: http://markmail.org/message/z5lcz2htjvqsscam

I have these two scenario with indexes.
One:
2 indexes; One with documents that has a field "field_one" instantiated as
TOKENIZED and then setOmitNorms(true).
Second index with the same field "field_one" instantiated TOKENIZED and then
setBoost(boost_factor);

Two:
2 indexes; One with field "field_one" instantiated as TOKENIZED and then
setOmitNorms(true).
Second index with the same field "field_one", but some of them are as first
index and some were instantiated TOKENIZED and then setBoost(boost_factor);
A mix of the two types.

If I am to load these two indexes into an IndexReader and query on the field
"field_one" would there be any issues that I should expect?

Any advice is much appreciated.

Cheerio


Re: Range search in dependent collections

2009-02-23 Thread Ian Lea
Just repeat the first and last names in each document.  How many users
and jobs are you talking about?  Lucene will cope unless the numbers
are extremely large.

Note that I'm not claiming this is necessarily the "best" way, just
the simplest which is often, but not always, the best.


--
Ian.

On Mon, Feb 23, 2009 at 2:49 PM, Mykola Peleshchyshyn
 wrote:
> What about the case with several jobs? I.e.:
>
> firstname: whatever
> lastname: whatever
>
> jobtitle1: somejob
> startdate1: whenever
> enddate1: whenever
> .
> jobtitleN: somejob
> startdateN: whenever
> enddateN: whenever
>
>
>
> - Original Message 
> From: Ian Lea 
> To: java-user@lucene.apache.org
> Sent: Monday, February 23, 2009 4:14:37 PM
> Subject: Re: Range search in dependent collections
>
> Hi
>
>
> The simplest way is to flatten your data into lucene documents that
> hold all relevant info for user/job combinations.  That will let you
> search easily across whichever fields you want.
>
> Your documents could look like this:
>
> firstname: whatever
> lastname: whatever
> jobtitle: somejob
> startdate: whenever
> enddate: whenever
>
> and searches could be something like lastname:whatever jobtitle:somejob.
>
>
> --
> Ian.
>
>
> On Mon, Feb 23, 2009 at 9:12 AM, Mykola Peleshchyshyn
>  wrote:
>> Hello,
>> I'm new to Lucene and I have the following problem:
>>
>> I have a Users with first name, last name etc. and User Jobs (collection) 
>> with job title, start date, end date.
>>
>> I need to perform search on all user fields (fist name, last name etc) and 
>> job fields (job title and optionally start date and end date).
>>
>> What would be the best way to index and search this data?
>>
>> Thank you,
>> Mykola Peleshchyshyn

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



Re: Range search in dependent collections

2009-02-23 Thread Mykola Peleshchyshyn
What about the case with several jobs? I.e.:

firstname: whatever
lastname: whatever

jobtitle1: somejob
startdate1: whenever
enddate1: whenever
.
jobtitleN: somejob
startdateN: whenever
enddateN: whenever



- Original Message 
From: Ian Lea 
To: java-user@lucene.apache.org
Sent: Monday, February 23, 2009 4:14:37 PM
Subject: Re: Range search in dependent collections

Hi


The simplest way is to flatten your data into lucene documents that
hold all relevant info for user/job combinations.  That will let you
search easily across whichever fields you want.

Your documents could look like this:

firstname: whatever
lastname: whatever
jobtitle: somejob
startdate: whenever
enddate: whenever

and searches could be something like lastname:whatever jobtitle:somejob.


--
Ian.


On Mon, Feb 23, 2009 at 9:12 AM, Mykola Peleshchyshyn
 wrote:
> Hello,
> I'm new to Lucene and I have the following problem:
>
> I have a Users with first name, last name etc. and User Jobs (collection) 
> with job title, start date, end date.
>
> I need to perform search on all user fields (fist name, last name etc) and 
> job fields (job title and optionally start date and end date).
>
> What would be the best way to index and search this data?
>
> Thank you,
> Mykola Peleshchyshyn

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


  

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



Re: Range search in dependent collections

2009-02-23 Thread Ian Lea
Hi


The simplest way is to flatten your data into lucene documents that
hold all relevant info for user/job combinations.  That will let you
search easily across whichever fields you want.

Your documents could look like this:

firstname: whatever
lastname: whatever
jobtitle: somejob
startdate: whenever
enddate: whenever

and searches could be something like lastname:whatever jobtitle:somejob.


--
Ian.


On Mon, Feb 23, 2009 at 9:12 AM, Mykola Peleshchyshyn
 wrote:
> Hello,
> I'm new to Lucene and I have the following problem:
>
> I have a Users with first name, last name etc. and User Jobs (collection) 
> with job title, start date, end date.
>
> I need to perform search on all user fields (fist name, last name etc) and 
> job fields (job title and optionally start date and end date).
>
> What would be the best way to index and search this data?
>
> Thank you,
> Mykola Peleshchyshyn

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



Range search in dependent collections

2009-02-23 Thread Mykola Peleshchyshyn
Hello,
I'm new to Lucene and I have the following problem:

I have a Users with first name, last name etc. and User Jobs (collection) with 
job title, start date, end date.

I need to perform search on all user fields (fist name, last name etc) and job 
fields (job title and optionally start date and end date).

What would be the best way to index and search this data?

Thank you,
Mykola Peleshchyshyn 


  

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



problem with indexing

2009-02-23 Thread nitin gopi
hi all, I want to modify the indexing process lucene to suit my application.
I partially read the book LUCENE IN ACTION but it contains no information to
extract the term document matrix. I want to apply LSI to the indexed
document. Please somebody help me out.

regards
nitin