Solr field don't appear in index view

68 views
Skip to first unread message

Mathieu Bacault

unread,
Jan 21, 2013, 7:23:58 AM1/21/13
to blacklight-...@googlegroups.com
Hi,
In my index.properties, I added 2 fields (issn_t and ean_t). The first one appear both in index and show views, the second one appear only in show view but I would like it to be present in index view.
This problem exists also for display fields. (My catalog.controller is correctly configured with these fields in index and show sections.)

It seems to be a problem with value returned by this function : should_render_index_field?
It returns nil for ean_t, so it is not present in index view. But I don't understand this behavior.

I added issn_t in previous version of Blacklight on my developpement machine and recently added ean_t. Is there a cache function in solr or Blacklight ?
I deleted my solr index to test it but don't works.

Thank you to enlighten me.
Mathieu bacault.

Chris Beer

unread,
Jan 21, 2013, 9:41:21 AM1/21/13
to blacklight-...@googlegroups.com
Is ean_t a stored field? Have you reindexed since adding it? Are you returning it from Solr correctly?
> --
>
>

Mathieu Bacault

unread,
Jan 21, 2013, 10:03:37 AM1/21/13
to blacklight-...@googlegroups.com
>Is ean_t a stored field?
Yes, it is declared dynamically in index.properties but not declared in schema.xml, but it's the same thing for issn_t !


>Have you reindexed since adding it?
Yes, several times, it makes me crazy :)


>Are you returning it from Solr correctly?
I don't add code, if it's your question, but this appear with default templates.

I'm trying to reindex with an old index.properties file. Perhaps there is an encoding or syntax problem in this file ?

Mathieu.

Michael Levy

unread,
Jan 21, 2013, 1:28:57 PM1/21/13
to blacklight-...@googlegroups.com
Mathieu,

This also confused me when I was starting with Blacklight. In the list view, only fields returned in the "search" handler are available to the application. 

Here is what you need to do: any field you want to display in the list view, in addition to the configuration file, you must also add to solrconfig.xml. 

Find the section beginning
<requestHandler name="search" class="solr.SearchHandler" default="true">
and scroll down to the section beginning
<!-- NOT using marc_display because it is large and will slow things down for search results -->
       <str name="fl">
         id,
         score, ... etc

Add your fields there. You can also use "*" instead of listing each view, but based on the comment, the wildcard was not used due to the larger amount of Solr returned data.

In the "show" or detail view, fields returned in the "document" view are returned.

Robert J. Haschart

unread,
Jan 21, 2013, 2:50:02 PM1/21/13
to blacklight-...@googlegroups.com
Wheneven I need to track down such issues, I try looking at the solr index
directly, via the solr admin interface. That will tell you whether it is
an indexing issue, or an issue in the blacklight interface code.

Initially go to the admin interface page, and see whether the the fields are
returned by a default search (something like *:* )

It the field isn't displayed in the results that return, its an indexing
problem, if it is there, the problem is higher up.

Next I'd go to the Full Interface of the search page of the solr admin page,
and change the query type from standard to "search" or "document" (or
whatever the name of the query handler the blacklight interface uses for its
queries)

and see whether the desired field is in the results. Our query handlers
contain a list of what fields to return for the "search" and the "document"
results. If a desired field is not listed, theose query handlers won't
return that field.

If the desired field is in the results, then the problem is somewhere in the
blacklight code or configuration options, and the other fine folk here can
be of more help to you.




On Mon, 21 Jan 2013 07:03:37 -0800 (PST)
Mathieu Bacault <biblim...@gmail.com> wrote:
>>Is ean_t a stored field?
> Yes, it is declared dynamically in index.properties but not declared in
> schema.xml, but it's the same thing for issn_t !
>
>>Have you reindexed since adding it?
> Yes, several times, it makes me crazy :)
>
>>Are you returning it from Solr correctly?
> I don't add code, if it's your question, but this appear with default
> templates.
>
> I'm trying to reindex with an old index.properties file. Perhaps there is
> an encoding or syntax problem in this file ?
>
> Mathieu.
>
> Le lundi 21 janvier 2013 15:41:21 UTC+1, Chris Beer a �crit :
>>
>> Is ean_t a stored field? Have you reindexed since adding it? Are you
>> returning it from Solr correctly?
>>
>>
>> On 21 Jan, 2013, at 4:23 , Mathieu Bacault
>><biblim...@gmail.com<javascript:>>
>> wrote:
>>
>> > Hi,
>> > In my index.properties, I added 2 fields (issn_t and ean_t). The first
>> one appear both in index and show views, the second one appear only in
>>show
>> view but I would like it to be present in index view.
>> > This problem exists also for display fields. (My catalog.controller is
>> correctly configured with these fields in index and show sections.)
>> >
>> > It seems to be a problem with value returned by this function :
>> should_render_index_field?
>> > It returns nil for ean_t, so it is not present in index view. But I
>> don't understand this behavior.
>> >
>> > I added issn_t in previous version of Blacklight on my developpement
>> machine and recently added ean_t. Is there a cache function in solr or
>> Blacklight ?
>> > I deleted my solr index to test it but don't works.
>> >
>> > Thank you to enlighten me.
>> > Mathieu bacault.
>> >
>> > --
>> >
>> >
>>
>>
>
> --
>
>

Mathieu Bacault

unread,
Jan 22, 2013, 8:14:58 AM1/22/13
to blacklight-...@googlegroups.com
Thank you very much for help and tips. It works now !

Have a good day.

Aakash

unread,
May 9, 2013, 12:53:58 PM5/9/13
to blacklight-...@googlegroups.com
I am facing same issue, can you please explain how did you make it work?

Thanks,
Reply all
Reply to author
Forward
0 new messages