Documents loaded but no results even with *:*

78 views
Skip to first unread message

Greg Elin

unread,
Mar 11, 2012, 8:25:33 AM3/11/12
to Blacklight Development
I am relatively new to Solr and Blacklight, but had basic elements
working until I tried to get beyond the default Marc records.

I set up a new rails app with default configuration for backlight. So
far so good.

Then I modified the schema.xml to recognize new fields for different
types of docs. I created a solrxml doc to post new items to index. I
can successfully post the solrxml file using post.jar. It gets
committed. I see the new and accurate document count in solr admin. (I
have not loaded any marc records.)

And yet i get no search results when I search. I am looking at just
the solr admin interface. I search for an explicit value with a field.
I search for *:*. Everyhing returns no results.

I have looked at solrconfig.XML and even set up a new requesthandler
and set it as default. I stop and start solr after each change.

I believe I am missing something small and obvious but cannot figure
it out.

Any help would be appreciated. I am eager to use backlight.

Greg

Jonathan Rochkind

unread,
Mar 12, 2012, 11:32:34 AM3/12/12
to blacklight-...@googlegroups.com, Greg Elin
Since you're not finding the document as you expected just using the
Solr admin interface, this isn't yet a Blacklight issue -- we've just
got to figure out what's going on with Solr. Which is a fine place to
start, a good understanding of how to use Solr is neccesary to set up
Blacklight properly.

I don't use the Solr admin interface , but I'd guess it's ending up
querying a field you haven't actually added any terms to. What Solr
query is generated by your admin query? (What URL is in your browser
after you do your admin query?). A "*:*" query is going to end up being
to a specific field -- either specified in the URL, or a default field
specified in your solrconfig.xml for the particular solr request handler
you're using -- the solr request handler can also be specified in the
Solr request URL, or else a default request handler is used. That's
assuming a request handler using the 'lucene' query parser; if you're
using a request handler with the 'dismax' query parser, then there are
other considerations (and "*:*" may not be a valid query).

Hope this helps. Since at the moment you're dealing purely with Solr,
you could also ask on the solr-user listserv, but I believe several of
us are happy to help you here as well.

Jonathan

Erik Hatcher

unread,
Mar 12, 2012, 11:39:12 AM3/12/12
to blacklight-...@googlegroups.com, Greg Elin
To clarify/correct... /select?q=*:* (assuming on changes to the default query parser), it's not specific to any field. Underneath that generates a MatchAllDocsQuery, and literally does that. So if you're not seeing the document that way then something is way fishy or you didn't commit as you thought you had. post.jar doesn't always commit, you have to do that explicitly. java -Dcommit=yes -jar post.jar ....

To eliminate the query parser confusion from the equation, you can try /select?q={!lucene}*:* to see if that helps, though it's probably simply a commit issue.

Erik

> --
> You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
> To post to this group, send email to blacklight-...@googlegroups.com.
> To unsubscribe from this group, send email to blacklight-develo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/blacklight-development?hl=en.
>

Greg Elin

unread,
Mar 13, 2012, 12:20:53 PM3/13/12
to Blacklight Development
Thank you for responding.

I made further progress from when I posted and I think I can be more
articulate.

I'm confident this is a Blacklight configuration question rather than
purely Solr.
I fired up a different instance of Solr outside of Blacklight, loaded
the documents,
and had success with the query. I know I committed my documents in my
Blacklight instance b/c I was getting correct document counts. I also
know that
I set up the fields correctly in schema.xml to accept my solrxml
document.

From what I can tell, the default configuration inside of Blacklight
sets the query
to use Search requestHandler when talking to Solr. That handler has a
variety of configuration
information.
( <requestHandler name="search" class="solr.SearchHandler" >)

At first I tried some variations in side the Search requestHandler.
But I could never
get any documents back regardless of what fields in the handler I
commented out related to Marc.

So I created a new requestHandler and adjusted the Blacklight Ruby
code to not default to Search requestHandler.
Here is the handler I added:

<requestHandler name="standard" class="solr.StandardRequestHandler"
default="true">
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
<!--
<int name="rows">10</int>
<str name="fl">*</str>
<str name="version">2.1</str>
-->
</lst>
</requestHandler>

With the new requestHandler added, and the modification to defaults in
the Ruby code,
my search is now returning results.

But I am still trying to get my head around what is happening inside
the Search requestHandler that would
cause a failure if (a) my docs are loaded, (b) I comment out (or do
not comment out) the Marc record related items,
and (c) I have no Marc records loaded into Solr.

I am new to Solr...and my Rails is rusty. So I might not be seeing the
obvious.

Greg Elin

Greg Elin

unread,
Mar 13, 2012, 12:25:17 PM3/13/12
to Blacklight Development
Erik,

Thanks for responding. I sent a longer response to Jonathan Rochkind.
Let's see if that shows up in the Forum. It explains that I am
confident docs were committed
into the Blacklight Solr instance b/c I am getting correct doc counts
and b/c I was able to
get results after creating a distinct requestHandler AND modifying
some defaults in the Ruby code.

I think what I am looking for, either in documentation, or via a
friendly brief tutorial, is understanding
more clearly how the solrconfig.xml, schema.xml, and Ruby calling code
are wired together and what the
modifications are to Blacklight's solrconfig.xml v. default Solr
solrconfig.xml.

BTW, Blacklight is really beautiful! Much nicer out of the box than
some alternatives. I've enjoyed
your screencasts.

Greg Elin

Jason V

unread,
Mar 19, 2012, 2:31:25 PM3/19/12
to Blacklight Development
Hi Greg,

I believe the request handler in the Blacklight generated
solrconfig.xml is setup to use dismax. So instead of searching for
*:*, try searching for [*to*]

Let me know if this works..Thanks

Jason Varghese
New York Public Library
> > > For more options, visit this group athttp://groups.google.com/group/blacklight-development?hl=en.- Hide quoted text -
>
> - Show quoted text -

Erik Hatcher

unread,
Mar 19, 2012, 2:35:42 PM3/19/12
to blacklight-...@googlegroups.com
Just FYI... even [* TO *] is lucene query parser syntax and isn't dismax savvy. However, *e*dismax supports *:* and [* TO *] as it supports full Lucene query parser syntax. Dismax supports terms, phrases, and +/-, that's it.

Erik

Jason V

unread,
Mar 19, 2012, 3:04:25 PM3/19/12
to Blacklight Development
Thanks Erik. I don't know why I'm getting back results when I search
against [*to*], but I see its not a full result set. Perhaps its
actually searching against that string...

However if issue a search query in the form http://localhost/solrwebappname/select/

I get back numFound for all items in my index. I guess this is
because the solrconfig.xml defines the following:

<lst name="defaults">
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<str name="q.alt">*:*</str>
> >>>> For more options, visit this group athttp://groups.google.com/group/blacklight-development?hl=en.-Hide quoted text -

Naomi Dushay

unread,
Mar 19, 2012, 3:08:07 PM3/19/12
to blacklight-...@googlegroups.com
Jason,

Yes, the empty query will return all documents because it defaults to dismax *:*, which returns all documents.

- Naomi

Reply all
Reply to author
Forward
0 new messages