Updating a document.

2012-03-04 Thread Benson Margulies
I am walking down the document in an index by number, and I find that
I want to update one. The updateDocument API only works on queries and
terms, not numbers.

So I can call remove and add, but, then, what's the document's number
after that? Or is that not a meaningful question until I make a new
reader?

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



Re: Updating a document.

2012-03-04 Thread Li Li
if you want to identify a document, you should use a field such as url as
Unique Key in solr

On Mon, Mar 5, 2012 at 12:31 AM, Benson Margulies wrote:

> I am walking down the document in an index by number, and I find that
> I want to update one. The updateDocument API only works on queries and
> terms, not numbers.
>
> So I can call remove and add, but, then, what's the document's number
> after that? Or is that not a meaningful question until I make a new
> reader?
>
> -
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>


Re: Updating a document.

2012-03-04 Thread Li Li
document id will be subject to changes. and all segments' document id is
starting from zero. after a merge, document ids will also change.

On Mon, Mar 5, 2012 at 12:31 AM, Benson Margulies wrote:

> I am walking down the document in an index by number, and I find that
> I want to update one. The updateDocument API only works on queries and
> terms, not numbers.
>
> So I can call remove and add, but, then, what's the document's number
> after that? Or is that not a meaningful question until I make a new
> reader?
>
> -
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>


PrecedenceQueryParser vs. QueryParser discrepancy

2012-03-04 Thread wburzyns

Hi devs,

There is a discrepancy in parsing behavior between PrecedenceQueryParser 
and QueryParser if the query is both single term and negative-only, e.g. 
"-exchange:nasdaq".


In this case with QueryParser the returned Query object is instanceof 
BooleanQuery whereas with PrecedenceQueryParser it's of TermQuery 
instance. This is inconvenient since with the parsed query which is an 
instance of BooleanQuery class it's easy to check if the user-supplied 
query is negative only. This is not possible with TermQuery. This also 
means that the PrecedenceQueryParser parses "-exchange:nasdaq" to 
"+exchange:nasdaq". What's interesting, there is no such problem with 
negative-only queries consisting of at least two terms.


Is the above behavior a "feature" of the contrib parser or a bug?


Thanks,
Wojtek Burzynski

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



Return value (or lack thereof) from IndexWriter.deleteDocuments

2012-03-04 Thread Benson Margulies
Is there a reason why this doesn't return a count? Would a JIRA
requesting same be viewed with any sympathy?

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



Re: Return value (or lack thereof) from IndexWriter.deleteDocuments

2012-03-04 Thread Francisco A. Lozano
Today I was thinking the same with the update operation.

Is there any reason these are not provided?

Francisco A. Lozano



On Sun, Mar 4, 2012 at 22:42, Benson Margulies  wrote:
> Is there a reason why this doesn't return a count? Would a JIRA
> requesting same be viewed with any sympathy?
>
> -
> 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: Return value (or lack thereof) from IndexWriter.deleteDocuments

2012-03-04 Thread Michael McCandless
It's because the delete is buffered and only later applied in batch...
so we can't easily know the count.

Mike McCandless

http://blog.mikemccandless.com

On Sun, Mar 4, 2012 at 4:42 PM, Benson Margulies  wrote:
> Is there a reason why this doesn't return a count? Would a JIRA
> requesting same be viewed with any sympathy?
>
> -
> 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



which fields are included in similarity?

2012-03-04 Thread Benson Margulies
   TopDocs top = searcher.search(contextQuery, filter, maxDocsToRetrieve);

Which document fields are included in the calculation of the scores in
the returned items? All fields? All fields touched in the query? Would
I need a custom Similarity to exclude some?

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