Sorry Hoss if I came down too hard against the view that "*" should mean "all docs". With the renewed clarity that getting a little sleep brings, I better appreciate the merits of your position. And that it's dangerous trying to decide what makes sense for other people.
Obviously from a practical perspective, a MatchAllDocsQuery is quite a bit faster than matching all docs having some value for a particular field, and should be encouraged unless the latter is explicitly desired. Now I think there is fair agreement that it would be great if field:* could be made to work. So if some portion of users want unqualified * to be mapped into a MatchAllDocsQuery, while others would want it to be processed as the equivalent of <default-field>:*, then perhaps there should be a configuration directive which controls whether unqualified * (or perhaps any defined string) is trapped? I haven't come across existing SOLR code to handle "*" as a special case of PrefixQuery, so I assume the trapping should be at the level of SolrQueryParser, similar to how [* TO *] is trapped for range queries? I'm working on some mods to SolrQueryParser which I hope to get to the point I can submit for review in the next week or so; I'd be happy to add this as well if there is agreement the approach makes sense. - J.J. At 4:31 PM -0500 1/23/07, J.J. Larrea wrote: >At 11:17 AM -0800 1/23/07, Chris Hostetter wrote: >>my point was just that if you arne't very familiar with teh syntax and >>you say: " q=* " you might assuming you'll get all docs -- and unless your >>defaultSearchField is something weird, you will get a lot of docs, but not >>neccessarily all. if someone searches for: " q=[* TO *] " then they >>probably didn't just guess that, they probably know something about the >>syntax, and are more likely to realize they are just searching a single >>(default field). > >I respectfully disagree. By the same argument, q=heaven would lead to the >expectation that all documents with the word 'heaven' would be returned. > >But that's not the expectation -- it's that a field-unqualified clause will be >qualified by the default field, whether it evaluates to a TermQuery, >PhraseQuery, PrefixQuery, RangeQuery, RegexpQuery, WildcardQuery, etc. -- with >'*' being -conceptually- understood as a form of PrefixQuery with a null >prefix, as Yonik said: > >>It's just that it normally surprises people that they can do foo:a* >>and not foo:* > >If the field qualification is dropped, it should operate the same way on the >default field. > >>: *:* to find all documents regardless of field seems good to me, where >>: as simply * or [* TO *] would use the default field. >> >>i guess what i'm saying is that while i like the syntax of " q=field:* " >>to mean everything with a value in that field, i don't think it's worth >>adding it if as a side effect " q=* " becomes a legal expression that >>does the same thing for hte default field, because it will be more >>missleading. > >I see things differently here too... an uneducated user doesn't know field >names, an educated user does. If an uneducated user is frustrated with >field-unqualified queries e.g. q=word not returning all documents with that >word, the first thing they are going to learn is q=*:word; extending to q=*:* >is pretty natural, IMHO. > >- J.J.