문제

I have integrated Lucene.net and nhibernate.search together. I have a domain object that contains a file path, and this file path leads to a file on disc, which has file content. How would I use Lucene.Net/nhibernate.search to search through the file content of a saved file?

My index is being changed automatically with some listeners every time i save/delete/update the domain object.

[Indexed]
public class Book {
    private int id;
    private string name;
    private string filename;

    public Book() {
    }

    public Book(int id,string name, string filename) {
        this.id = id;
        this.name = name;
        this.filename = filename;
    }

    [DocumentId]
    public virtual int Id {
        get { return id; }
        set { id = value; }
    }

    [Field(Index.Tokenized, Store = Store.Yes)]
    public virtual string Name {
        get { return name; }
        set { name = value; }
    }  

    [Field(Index.Tokenized, Store = Store.Yes)]
    public virtual string FileName {
        get { return filename; }
        set { filename = value; }
    }
}
도움이 되었습니까?

해결책

You will have to index that file content first with Lucene.Net

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top