lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: After adding field to schema, the field is not being returned in results.
Date Thu, 01 Nov 2012 19:09:50 GMT
What happens if you sort ascending rather than descending? Depending on
what (if anything) you've done with sortMissingFirst/Last on that field,
it's possible that you're just seeing the results of the sort and docs with
your new field are somewhere down the list. If you've done nothing, you
should be seeing the docs with the new field at the top of the list  with
the query you posted, so this is grasping at straws a bit.

The solr admin page, try going to collection>>schema browser and choose the
field in question from your drop-down. see if it looks like it is stored
and indexed, and see what some of the values are. This is getting the vals
from the indexed terms, but at least it should say "stored" in the schema
and index sections. If it doesn't, then you somehow have a mismatch between
your schema and what's actually in your index. This really shouldn't be the
case since it's a brand-new field....

Two other things I'd try.
1> If you have the ID of the document you're _sure_ has a date field in it
try your query just on that, with fl=*. This would avoid any possible
sortMissingFirst/Last issues.

2> Another way to restrict this would be to add an "fq" clause to the query
so docs without the field would not be displayed, something like
fq=[NOW-1YEAR TO NOW] assuming your dates are in the last year.

But I guess we're down to needing to see the schema definition etc. if that
doesn't work.


On Thu, Nov 1, 2012 at 11:55 AM, Dotan Cohen <> wrote:

> On Thu, Nov 1, 2012 at 3:00 PM, Erick Erickson <>
> wrote:
> > I'd try several things....
> >
> > 1> just because you an sort has nothing to do with whether the field is
> > returned. Sorting uses the indexed data, returning it is the stored data.
> > So it's a bit of a red herring when you can sort on a field but not see
> it,
> > although it is a good test that your schema knows about the field.
> >
> Right, the only thing that I was testing for is that the field is
> recognised by Solr. If I had a typo in the field name in the query or
> in the schema, Solr would have complained.
> > 2> Try fl=* just for yucks.
> >
> yuck, yuck, but didn't work!
> > 3> Check your schema.xml for typos. stroed="true" for instance?
> No, tried that. Good thinking, though.
> > 4> Why are you restricting your returns to 1 and only one document? Are
> you
> > absolutely sure that that document has the new field? Solr happily sorts
> > documents that do not have a value for a field, that's the purpose of
> > sortMissingFirst/Last.
> >
> All the newest documents have the field, and I'm sorting by time
> descending. In fact, I did test with more rows, but for the mailing
> list I wanted the output to be concise.
> Thanks.
> --
> Dotan Cohen

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message