Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy field retrieval #24

Open
chriseldredge opened this issue May 15, 2013 · 2 comments
Open

Lazy field retrieval #24

chriseldredge opened this issue May 15, 2013 · 2 comments

Comments

@chriseldredge
Copy link
Owner

Supposing a document like:

public class Book
{
  public string Title { get; set; }
  public string Author{ get; set; }
  public string Text{ get; set; }
}

And a query like:

from b in books
where b.Title == "foo" || b.Author == "bar"
select new { b.Title, b.Author };

Lucene.Net.Linq should not retrieve large, possibly compressed fields like Text since the client is not using that field.

@richardgavel
Copy link

Out of curiosity, in raw Lucene, is there a performance benefit to not reading fields in a Document even though it's already been loaded from the index?

@chriseldredge
Copy link
Owner Author

This would be a performance optimization that may only benefit certain use cases where a given field is very large or uses compression and won't be used. See [IndexReader.Document](https://lucene.apache.org/core/old_versioned_docs/versions/3_0_1/api/all/org/apache/lucene/index/IndexReader.html#document%28int, org.apache.lucene.document.FieldSelector%29).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants