0

All:

I am pretty new to SOLR, I upload some documents which have "season" in content field(store but not indexed, copy to text field) and in title field(store and indexed copy to text field)

When I use basic query without dismax like:

http://localhost:8983/solr/collection1/select?q=season&rows=5&wt=json&indent=true

It works very well and return correct results, but when I want to boost those documents which have more "season" in content rather than title, I used dismax like(I guess the way I use it is totally, cos the content is not indexed, but I at least expect certain return result even incorrect ):

http://localhost:8983/solr/collection1/select?q=season&rows=5&wt=json&indent=true&defType=dismax&qf=content%5E100+title%5E1

There is no match result returned, I wonder if anyone could help me with this? Or could anyone show me how to use dismax correctly

Thanks

Prometheus
  • 1,148
  • 14
  • 21
Kuan
  • 11,149
  • 23
  • 93
  • 201

2 Answers2

1

In your second query you specify the "content" field as the one and only query field but earlier you write that this field is stored but not indexed. If a field is not indexed you can not search against it.

Ronald
  • 2,864
  • 3
  • 25
  • 36
  • Thanks, I do not quite understand how SOLR works: in my guessing, I just boost a field rather than search in it, the search field is "text"( indexed but not stored), and even if that field can not be searched or scored, at least it should return certain results incorrect. – Kuan Mar 31 '15 at 16:08
  • The reason I want to do this is because: some documents have "season" in title part but with a very small body content, which leads to a high scoring in the result if I just use basic query. I want to make the query item hits in content field scored higher that title(I can not just simply exclude title, cos I still want it in result) , so I have to indexed the content as well? – Kuan Mar 31 '15 at 16:24
  • 1
    If you want to work with Solr seriously you need to build up some basic knowledge. I can recommend the excellent book "Solr in Action". – Ronald Mar 31 '15 at 17:43
0

I faced the same problem. Tracked it down to the schema definition where for dismax to work, field type should be text and not string

for e.g text_general,text_en_splitting,text_en

Its because of the tokenizers used for this field types.

-->

Nandish
  • 306
  • 3
  • 6