Advanced Querying

Here are some of the special features in Lucinq
Query manipulation

One really cool feature of lucene is the ability to manipulate and re-execute queries. This means that if say – you only want to change a single parameter, then can simply change it


IQueryBuilder queryBuilder = new QueryBuilder();

queryBuilder.Term(BBCFields.Title, "africa", key: "africacriteria");

LuceneSearchResult results = ExecuteAndAssert(luceneSearch, queryBuilder, 8);

queryBuilder.Queries.Remove("africacriteria"); queryBuilder.Term(BBCFields.Title, "report", key: "businesscriteria");

Console.WriteLine("\r\nSecond Criteria");

LuceneSearchResult results2 = ExecuteAndAssert(luceneSearch, queryBuilder, 5);

Assert.AreNotEqual(results.TotalHits, results2.TotalHits);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s