Re: Reuse single document and fields

2008-02-01 Thread Michael McCandless
Right, the value in a Field cannot be null. Mike Jay wrote: You are right, Lucene only gives IllegalArgumentException when the value is null. I assume it won't skip the field is the value is empty or null? Thanks! Jay Michael McCandless wrote: As far as I know, Lucene should accept a f

Re: Concurrent Indexing + Searching

2008-02-01 Thread Mark Miller
1) I should be calling release of writer and searcher after every call. Is it always mandatory in cases like searcher, when I am sure that I havn't written anything since the last search ? You have to be careful here. It works like this: a single searcher is cached and returned every time. O

Re: Concurrent Indexing + Searching

2008-02-01 Thread Infinite Tester
Thanks Mark! Option D looks great. Regarding that option, I have couple of questions based on my first glance at the code ( more specifically SimpleSearchServer ) 1) I should be calling release of writer and searcher after every call. Is it always mandatory in cases like searcher, when I am sure

Re: Reuse single document and fields

2008-02-01 Thread Jay
You are right, Lucene only gives IllegalArgumentException when the value is null. I assume it won't skip the field is the value is empty or null? Thanks! Jay Michael McCandless wrote: As far as I know, Lucene should accept a field with an empty string value -- how did you hit the IllegalArg

Re: Concurrent Indexing + Searching

2008-02-01 Thread Mark Miller
You are not seeing the doc because you need to close the IndexWriter first. To have an interactive index you can: A: roll your own. B: use Solr. C: use the original LuceneIndexAccessor https://issues.apache.org/jira/browse/LUCENE-390 D: use my updated IndexAccessor https://issues.apache.org/ji

Concurrent Indexing + Searching

2008-02-01 Thread codetester
Hi All, A newbie out here I am using lucene 2.3.0. I need to use lucene to perform live searching and indexing. To achieve that, I tried the following FSDirectory directory = FSDirectory.getDirectory(location); IndexReader reader = IndexReader.open(directory ); IndexWriter writer = new Index

Re: Reuse single document and fields

2008-02-01 Thread Michael McCandless
As far as I know, Lucene should accept a field with an empty string value -- how did you hit the IllegalArgumentException? Mike Jay wrote: Thanks, Michael, for your quick reply and explanation. One related question: is it true that Lucene indexer will reject a field that has the empty s

Re: Lucene File Formats web page

2008-02-01 Thread Michael McCandless
Woops, you are correct, the file formats doc is out of date. It should be #1. I'll fix it -- thank you for raising it! Mike Ivan Vasilev wrote: Hi Guys, In the File Formats web page (http://lucene.apache.org/java/2_3_0/ fileformats.html) there is section describing Segments File, where

Lucene File Formats web page

2008-02-01 Thread Ivan Vasilev
Hi Guys, In the File Formats web page (http://lucene.apache.org/java/2_3_0/fileformats.html) there is section describing Segments File, where we read: Segments --> Format, Version, NameCounter, ... ... Format is -1 as of Lucene 1.4 and -3 (SemgentInfos.FORMAT_SINGLE_NORM_FILE) as of Lucene 2

Re: Reuse single document and fields

2008-02-01 Thread Jay
Thanks, Michael, for your quick reply and explanation. One related question: is it true that Lucene indexer will reject a field that has the empty string value? (I saw an IllegalArgumentException). Will be nice if lucene just skip such a field silently, esp, for the new 2.3 api. Jay Michael M

Re: Different levels of negative boosting

2008-02-01 Thread prabin meitei
Hi Grant, I have an index for articles containing fields 'id' , 'body' and others BooleanQuery query = new BooleanQuery; queryParser = new QueryParser("body", new StandardAnalyzer()); query.add(queryParser.parse("keywords"), Occur.MUST); if i query at this level then i get all the articles I

Re: Different levels of negative boosting

2008-02-01 Thread Grant Ingersoll
Hi Prabin, Can you give an example of what you would like a query to look like? Lucene doesn't do negative boosts (ok, w/ a patch, I think it can, but...) At any rate, the boosts are relative, so perhaps you just lower the boost to be very small for the "bad" terms and raise it higher f

Re: Using a QueryParser with an untokenized field?

2008-02-01 Thread Eleanor Joslin
Thank you, this was exactly what I needed. So "tokenizing" really denotes a more general process that can involve normalizing the case or whatever else can be done with a filter. This is where I was confused. Eleanor Jan Peter Stotz wrote: Hi Eleanor. In my Lucene index there's a field tha

How can I get document's top n raw score?

2008-02-01 Thread Lisa Lee
I need know document's top n raw score & term. For example, If one document have {apple, banana, coconut} terms, and I need top 2 score in the document. Simple way is just search all term in the document and sort the score - like as below. first, search about 'apple' term then write the score

Re: Distributed Lucene Directory

2008-02-01 Thread Cedric Ho
On Feb 1, 2008 9:47 AM, Mark Miller <[EMAIL PROTECTED]> wrote: > > Cedric Ho wrote: > > > > But managing such a set of indexes is not trivial. Especially when > > need to add redundancies for reliability and update frequently. > > > Agreed. Apparently the Solr guys are working on this now. Certainl

Re: Reuse single document and fields

2008-02-01 Thread Michael McCandless
yu wrote: Hi, I am trying to use the latest 2.3 API on Field to improve the indexing performance by reusing Documents and Fields. After reading lucene-java wiki and the java doc on Field, I have a couple of questions about the comment in Field.setValue(), namely, "Note that you should

Re: appending field to an existing index

2008-02-01 Thread Michael McCandless
John Wang wrote: Thanks Chris! This works with lucene2.1 and greater (breaks with lucene2.0) A follow up question, anyway to rename and to delete a field. Rename field: I tried to use a hex editor to edit the .fnm file (screwed up my index, but I was careful and followed the index format

Re: appending field to an existing index

2008-02-01 Thread Michael McCandless
Woops -- disregard this! Chris' approach will work. And, we don't need addParallelIndices! Mike Michael McCandless wrote: I don't think this will do the right thing in this case, because addIndexes "appends" the documents from all indices together. Whereas John wants to "merge in" a

Re: appending field to an existing index

2008-02-01 Thread Michael McCandless
I don't think this will do the right thing in this case, because addIndexes "appends" the documents from all indices together. Whereas John wants to "merge in" a new field into all docs in an existing index. Really what we need is a new "addParallellIndices" method. I think, conceptual

Re: Using a QueryParser with an untokenized field?

2008-02-01 Thread Jan Peter Stotz
Hi Eleanor. In my Lucene index there's a field that contains the local names of XML elements, one name per document. Users can enter arbitrary queries for this field, so I'm using a QueryParser. From reading around it looks as if the field needs to be tokenized, but since the field's conten

Re: appending field to an existing index

2008-02-01 Thread John Wang
Thanks Chris! This works with lucene2.1 and greater (breaks with lucene2.0) A follow up question, anyway to rename and to delete a field. Rename field: I tried to use a hex editor to edit the .fnm file (screwed up my index, but I was careful and followed the index format) Deleting a field: ideas?