edismax

Wildcard searches using dismax handler?

自古美人都是妖i 提交于 2019-12-10 13:48:26
问题 I have successfully indexed files, and want to be able to search using wildcards. I am currently using the dismaxRequestHandler (QueryType = dismax) for the searches so that I can search all the fields for the query. A general search like 'computer' returns results but 'com*er' doesn't return any results. Similary, a search like 'co?mput?r' returns no results. Could someone please tell me a way to continue using dismax and be able to do wildcard searches in the 'q' field? Does edismax handler

Solr date boost and sort by relevant results NOT working properly

一曲冷凌霜 提交于 2019-12-08 04:32:10
问题 I am implementing Solr dismax search and also using this function recip(ms(NOW,PubDate),3.16e-11,1000,1000) for date boost. Everthing is working fine but only got one problem. if search keywords are repeated in the Title, they get more score than recent results. e.g. 1) Title = solr lucene Date = 1 day old 2) Title = solr lucene is best, love solr lucene Date = 15 days old If user searched for 'solr lucene', then #2 comes at first position only because keywords are repeated in the Title. I

Substring matches within SOLR

自古美人都是妖i 提交于 2019-12-05 23:54:05
问题 I can't seem to figure out how to find substring matches with SOLR, I've figured out matches based on a prefix so I can get ham to match hamburger. How would I get a search for 'burger' to match hamburger as well? I tried burger but this tossed an error '*' or '?' not allowed as first character in WildcardQuery. How can I match substrings using SOLR? 回答1: You can enable this but it will be very resource hungry (e.g. search for SuffixQuery). See: http://lucene.472066.n3.nabble.com/Leading

Solr: How to search multiple fields

落爺英雄遲暮 提交于 2019-12-04 13:10:54
I am using solrnet. I have a title and Description fields. I need to search both fields simultaneously. How do I do this? Jayendra's answer is correct, but if you want to do this without aggregating data in a single field at index-time (copyFields) and want to do it at query-time instead using the standard handler instead of dismax, in SolrNet you can do: var query = Query.Field("title").Is(mytitle) || Query.Field("Description").Is(mydescription); var results = solr.Query(query); See query operators and DSL for more information. If you are using a standard request handler - Create a new field

Solr Query with LIKE Clause

时光总嘲笑我的痴心妄想 提交于 2019-12-04 04:49:28
I'm working with Solr and I'd like to know if it is possible to have a LIKE clause in the query. For example, I want to know all organizations with "New York" in the title. In SQL, this would be written like Name LIKE 'New York%'. My question - how do you write a LIKE query in Solr? I'm using the SolrNet library, if that makes a difference. You just search for "New York", but first you need to properly configure your field's analyzer. For example you might want to start with a field type like text_general as defined in the default Solr schema . This field type will tokenize on whitespace and

How to boost fields in solr

会有一股神秘感。 提交于 2019-12-04 04:14:14
I already have the boost determined before hand. I have a field in the solr index called boost1 . This boost field will have a value from 1 to 10 similar to google PR rank. This is the boost that should be applied to every query ran in solr. here are the fields in my index Id Title Text Boost1 The boost field should be apply to every query. I am trying to implement functionality similar to Google PR rank. Is there a way to do this using solr? Jayendra you can add the boost during query e.g. q={!boost b=boost1} How_can_I_boost_the_score_of_newer_documents However, this may need to be added

Solr wrong sort text fields

丶灬走出姿态 提交于 2019-12-04 02:56:15
问题 I have "text_general" field in schema.xml <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr

Solr wrong sort text fields

亡梦爱人 提交于 2019-12-01 16:27:14
I have "text_general" field in schema.xml <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1

Sunspot `LIKE` query

一笑奈何 提交于 2019-12-01 11:37:42
I'm using sunspot . How can I run a LIKE query ( LIKE %q% )? I would like to do something like this: @search = Sunspot.search(User) do |q| q.text_fields { with(:company_name).like(params[:q]) } end.results instead of: @search = Sunspot.search(User) do |q| q.text_fields { with(:company_name).starting_with(params[:q]) } end.results which partially works for me. Reviewing the sunspot code, I found this piece of code: class StartingWith < Base private def to_solr_conditional "#{solr_value(@value)}*" end end It basically generates the following sunspot search hash: Sunspot.search(User) do |q| q

Sunspot `LIKE` query

五迷三道 提交于 2019-12-01 09:36:05
问题 I'm using sunspot . How can I run a LIKE query ( LIKE %q% )? I would like to do something like this: @search = Sunspot.search(User) do |q| q.text_fields { with(:company_name).like(params[:q]) } end.results instead of: @search = Sunspot.search(User) do |q| q.text_fields { with(:company_name).starting_with(params[:q]) } end.results which partially works for me. Reviewing the sunspot code, I found this piece of code: class StartingWith < Base private def to_solr_conditional "#{solr_value(@value)