lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: query action with wrong result size zero
Date Fri, 06 May 2016 15:39:09 GMT
bq: does this means that different kinds of docs can not be put into
the same solr core

You can certainly put different kinds of docs in the same core,
you just have to search them appropriately, something like
q=field1:value OR field2:value

Say doc1 had "value" in field1 (but did  not have field2)
and doc2 had "value" in field2 (but did not have field1)

Then the above query would return both docs.

However, this may have surprising results since presumably
the different "types" of docs represent very different things.
Let's say you have "people" and "places" docs. Ogden is a
surname, but there is also a city in Utah called "Ogden".
A search like above might return both and if the user expected
to be searching places they'd be surprised to see a person.

So, to sum up there's no restriction on having different types
of docs with different fields in Solr, you just have to search
them appropriately (and so the users get what they expect).

Very often, people will put a "type" field in the doc and restrict
what kinds of docs are returned with an fq clause (fq=type:people
in the above example for instance) when appropriate.


On Thu, May 5, 2016 at 10:58 PM, 梦在远方 <> wrote:
> thank you ,Jay Potharaju
> I got a discover, in the same one solr core , i put two kinds of docs, which means that
they does not have the same fields, does this means that different kinds of docs can not be
put into the same solr core?
> thanks!
> ----------------
> max mi
> ------------------ 原始邮件 ------------------
> 发件人: "Erick Erickson";<>;
> 发送时间: 2016年5月6日(星期五) 中午12:14
> 收件人: "solr-user"<>;
> 主题: Re: query action with wrong result size zero
> Please show us:
> 1> a sample doc that you expect to be returned
> 2> the results of adding '&debug=query' to the URL
> 3> the schema definition for the field you're querying against.
> It is likely that your query isn't quite what you think it is, is going
> against a different field than you think or your schema isn't
> quite doing what you think...
> On Thu, May 5, 2016 at 9:40 AM, Jay Potharaju <> wrote:
>> Can you check if the field you are searching on is case sensitive? You can
>> quickly test it by copying the exact contents of the brand field into your
>> query and comparing it against the query you have posted above.
>> On Thu, May 5, 2016 at 8:57 AM, mixiangliu <> wrote:
>>> i found a strange thing  with solr query,when i set the value of query
>>> field like "brand:amd",the  size of query result is zero,but the real data
>>> is not zero,can  some body tell me why,thank you very much!!
>>> my english is not very good,wish some body understand my words!
>> --
>> Thanks
>> Jay Potharaju

View raw message