开发者

How to find results that do NOT match a keyword?

开发者 https://www.devze.com 2023-03-28 17:36 出处:网络
Is there any way I ca开发者_如何学编程n user a NOT or other negation operator before a text search keyword for example,

Is there any way I ca开发者_如何学编程n user a NOT or other negation operator before a text search keyword for example,

NOT program

When I do such a search there are 0 records returned. Please let me know some way to achieve this option.


In Solr you can use the '-' minus sign as a NOT operator, so you would change your query to be

*:* - program

If you are using SolrNet, since that is how your question is tagged, you can do the following

solr.Query(new SolrQuery("*:*") && !new SolrQuery("program"));

Please see Querying in SolrNet for more details.

Updated: Per comment from Mauricio Scheffer


There aren't any search operators that perform the search parameters you are describing. My advice is to use the Google advanced search features. You can make your search much more specific in a number of ways, its really advanced.

0

精彩评论

暂无评论...
验证码 换一张
取 消