Rohit Gupta

Engaging talk on Microsoft Technologies ....My Resume

  Home  |   Contact  |   Syndication    |   Login
  39 Posts | 0 Stories | 52 Comments | 0 Trackbacks

News



Twitter












Archives

Image Galleries

Personal

January 2009 Entries

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati