Geeks With Blogs
Rohit Gupta Engaging talk on Microsoft Technologies ....My Resume
January 2009 Entries
ConfigSectionHandler for Hierarchical configs
Here is a quick way to create a ConfigSection Handler for reading Hierarchical configs. For e.g. suppose you need to read a config file which has the following structure: 1: <MainConfig> 2: <Company>MySpace</... 3: <SubConfig> 4: <ID>23</ID> 5: <Name>Rohit</Name> 6: <LastName>Gupta</L... 7: </SubConfig> 8: </MainConfig> For this you would create the 2 classes, one for the Parent Config and another for the child config ......

Posted On Wednesday, January 28, 2009 5:14 PM

Lucene: Multifield searches
We can run multifield searches in Lucene using either the BooleanQuery API or using the MultiFieldQueryParser for parsing the query text. For e.g. If a index has 2 fields FirstName and LastName and if you need to search for "John" in the FirstName field and "Travis" in the LastName field one can use a Boolean Query as such: 1: BooleanQuery bq = new BooleanQuery(); 2: Query qf = new TermQuery(new Lucene.Net.Index.Term("Firs... "John")); 3: Query ql = new TermQuery(new Lucene.Net.Index.Term("Last... ......

Posted On Wednesday, January 7, 2009 6:44 PM

Copyright © Rohit Gupta | Powered by: GeeksWithBlogs.net