You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Shalin Shekhar Mangar <sh...@gmail.com> on 2009/06/09 13:58:03 UTC

Default search field API weirdness

Hello,

Does anybody know why schema.getDefaultSearchField() was deprecated?

The javadoc for the deprecated method advises the use of
schema.getSolrQueryParser().getField(). But schema.getSolrQueryParser() does
not exist. There's a method schema.getSolrQueryParser(String) which accepts
the default search field name! If we pass null as the name, it creates a
SolrQueryParser using the deprecated schema.getDefaultSearchField() :)

This all seems weird and confusing to me. Why all this just to get to the
default search field?

-- 
Regards,
Shalin Shekhar Mangar.

Re: Default search field API weirdness

Posted by Grant Ingersoll <gs...@apache.org>.
See also http://www.lucidimagination.com/search/document/c29c9db73a96373f/indexschema_getdefaultsearchfieldname#c29c9db73a96373f 
  for similar discussion.

I too think it is weird.

On Jun 9, 2009, at 7:58 AM, Shalin Shekhar Mangar wrote:

> Hello,
>
> Does anybody know why schema.getDefaultSearchField() was deprecated?
>
> The javadoc for the deprecated method advises the use of
> schema.getSolrQueryParser().getField(). But  
> schema.getSolrQueryParser() does
> not exist. There's a method schema.getSolrQueryParser(String) which  
> accepts
> the default search field name! If we pass null as the name, it  
> creates a
> SolrQueryParser using the deprecated schema.getDefaultSearchField() :)
>
> This all seems weird and confusing to me. Why all this just to get  
> to the
> default search field?
>
> -- 
> Regards,
> Shalin Shekhar Mangar.