IndexSearcher and out of memory error

2009-04-30 Thread Bill.Chesky
Hello, I'm using Lucene 2.2.0. I've got a query class that wraps an IndexSearcher object. Right now, we create a new IndexSearcher each time my query class gets instantiated and then it gets used throughout the life of the query class. Multiple queries get made against the IndexSearcher object

RE: Search result ordering

2009-04-29 Thread Bill.Chesky
Unfortunately we do periodically add Documents to our index. However, I wasn't aware of the Lucene-assigned doc ID or Sort.INDEXORDER. This is good information to know. Who knows, we might be able to refactor things to use this method. Regarding performance, yes I have actually seen some d

RE: Search result ordering

2009-04-29 Thread Bill.Chesky
Thanks Erick, Basically, the ideal ordering is an alphabetical one based on a String value that is known at index creation. I was just wondering if there was anything I could do at index creation time that might help me enforce that ordering at query time (without using a Sort). To be honest,

Search result ordering

2009-04-29 Thread Bill.Chesky
Hello, I have a few questions about the ordering of search results: 1) Given a query, are the Documents contained in the Hits object that is returned by IndexSearcher.search(Query query) guaranteed to be in the same order from one call to the next (assuming the index has not been updated in the m

RE: Error: there are more terms than documents...

2009-04-23 Thread Bill.Chesky
I figured it out. We are using Hibernate Search and in my ORM class I am doing the following: @Field(index=Index.TOKENIZED,store=Store.YES) protected String objectId; So when I persisted a new object to our database I was inadvertently creating a document in the Lucene index with the tokenized a

RE: Error: there are more terms than documents...

2009-04-23 Thread Bill.Chesky
Doron, thanks for the reply. > Is it possible that, for at least one document, multiple "objectId" fields > were created? > This would also create this problem. I read that online as well. I don't think so. We do have an update process that updates the index. During the update process we have

RE: Error: there are more terms than documents...

2009-04-23 Thread Bill.Chesky
Sorry for that terrible formatting. Let me try again. == Hello, I'm getting a strange error when I make a Lucene (2.2.0) query: java.lang.RuntimeException: there are more terms than documents in field "objectId", but it's impossible to sort

Error: there are more terms than documents...

2009-04-23 Thread Bill.Chesky
Hello, I'm getting a strange error when I make a Lucene (2.2.0) query w/ the following call: java.lang.RuntimeException: there are more terms than documents in field "objectId", but it's impossible to sort on tokenized fields at org.apache.lucene.search.FieldCacheImpl$10.createValue(

RE: Testing for field existence

2008-08-18 Thread Bill.Chesky
Best regards Karsten Bill.Chesky wrote: > > Hello, > > I am creating fields for documents like this: > > > > String name = ... > > String value = ... > > doc.add(new Field(name, value, Field.Store.NO, > Field.Index.UN_TOKENIZED)); > ... >

Testing for field existence

2008-08-18 Thread Bill.Chesky
Hello, I am creating fields for documents like this: String name = ... String value = ... doc.add(new Field(name, value, Field.Store.NO, Field.Index.UN_TOKENIZED)); On the query side, sometimes I want to want to search for documents for which a given field, say 'foo' is equal to a giv

RE: Can you create a Field that is a copy of another Field?

2008-06-30 Thread Bill.Chesky
Actually, you've been a big help. Your 'data_type' field suggestion I think will work for our app and obviates the need for the Field copy functionality that I was originally asking about. Just having one problem with it still, but I think it has to do with my limited knowledge of how analyzer

RE: Can you create a Field that is a copy of another Field?

2008-06-30 Thread Bill.Chesky
Matthew, It has to do with the fact that we're trying to represent these Property entitities hierarchically. We are displaying them in a tree structure, similar to the way Windows Explorer displays directories and files your file system. E.g. all the states would be at the root level. If you

RE: Can you create a Field that is a copy of another Field?

2008-06-27 Thread Bill.Chesky
Hmmm, I think maybe I am missing something. In your design is the 'data' field indexed, i.e. searchable? Or is it an unindexed, stored field? I was thinking that both 'data' and 'data_type' were indexed and searchable. Maybe the confusion stems from the fact that for the Document correspon

RE: Can you create a Field that is a copy of another Field?

2008-06-27 Thread Bill.Chesky
Erick, Thanks for the response. I'm very sure the TokenStream is expensive. Not always but in some case, yes, it can take a long time to complete. However, I do like your approach. I'm going to try a different approach suggested by another poster first, but this is very interesting. Thank

RE: Can you create a Field that is a copy of another Field?

2008-06-27 Thread Bill.Chesky
Matthew, Thanks for the reply. This looks very interesting. If I'm understanding correctly your db_key, data and data_type are Fields within the Document, correct? So is this how you envision it? Document: State=California Field: 'db_key'='1395' (primary key into relational table, correct

RE: Can you create a Field that is a copy of another Field?

2008-06-27 Thread Bill.Chesky
Grant, Thanks for the reply. What we're trying to do is kind of esoteric and hard to explain without going into a lot of gory details so I was trying to keep it simple. But I'll try to summarize. We're trying to index entities in a relational database. One of the entities we're trying to in

Can you create a Field that is a copy of another Field?

2008-06-26 Thread Bill.Chesky
Hello Lucene Gurus, I'm new to Lucene so sorry if this question basic or naïve. I have a Document to which I want to add a Field named, say, "foo" that is tokenized, indexed and unstored. I am using the "Field(String name, TokenStream tokenStream)" constructor to create it. The TokenStr