You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2012/06/15 21:27:43 UTC

[jira] [Comment Edited] (SOLR-2724) Deprecate defaultSearchField and defaultOperator defined in schema.xml

    [ https://issues.apache.org/jira/browse/SOLR-2724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295873#comment-13295873 ] 

David Smiley edited comment on SOLR-2724 at 6/15/12 7:27 PM:
-------------------------------------------------------------

One thing I realized is that a delete query might depend on the default search field or operator -- which is a very bad idea and thus all the more reason to deprecate them. I've seen a real situation where a delete query script was accidentally given arguments where the devops guy thought they were entering in IDs (which looked like URLs) when they were being treated as queries.  So they were tokenized, and some random cross-section of the data was deleted, instead of getting an error about terms being ambiguous.

There is a test in SolrExampleTests line 499 that assumes a deleteByQuery("\?\?::\?\?") is going to fail due to a syntax exception when it will actually fail because no field name was specified in the query.  
                
      was (Author: dsmiley):
    One thing I realized is that a delete query might depend on the default search field or operator -- which is a very bad idea and thus all the more reason to deprecate them. I've seen a real situation where a delete query script was accidentally given arguments where the devops guy thought they were entering in IDs (which looked like URLs) when they were being treated as queries.  So they were tokenized, and some random cross-section of the data was deleted, instead of getting an error about terms being ambiguous.

There is a test in SolrExampleTests line 499 that assumes a deleteByQuery("??::??") is going to fail due to a syntax exception when it will actually fail because no field name was specified in the query.  
                  
> Deprecate defaultSearchField and defaultOperator defined in schema.xml
> ----------------------------------------------------------------------
>
>                 Key: SOLR-2724
>                 URL: https://issues.apache.org/jira/browse/SOLR-2724
>             Project: Solr
>          Issue Type: Improvement
>          Components: Schema and Analysis, search
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: SOLR-2724_deprecateDefaultSearchField_and_defaultOperator.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I've always been surprised to see the <defaultSearchField> element and <solrQueryParser defaultOperator="OR"/> defined in the schema.xml file since the first time I saw them.  They just seem out of place to me since they are more query parser related than schema related. But not only are they misplaced, I feel they shouldn't exist. For query parsers, we already have a "df" parameter that works just fine, and explicit field references. And the default lucene query operator should stay at OR -- if a particular query wants different behavior then use q.op or simply use "OR".
> <similarity> Seems like something better placed in solrconfig.xml than in the schema. 
> In my opinion, defaultSearchField and defaultOperator configuration elements should be deprecated in Solr 3.x and removed in Solr 4.  And <similarity> should move to solrconfig.xml. I am willing to do it, provided there is consensus on it of course.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org