Well, my use case is pretty much exactly what the standard says. In
working with facetting in Solr, sometimes it is useful/neccesary to have
the actual index key for a facet group be different than the display
value shown to the user. For instance, to get the facet values to be
sorted correctly by byte order ( you can't really customize solr sorting
of facets, it's byte order), you might need to mangle it a bit, but then
display it to the user in original form.
Or you might want to have the actual stored key be an internal
identifier, but then display to the user a different presentation label
-- so you don't need to re-index when you change the presentation label.
An extension of this is for internationalization -- different display
labels for different languages, but the same internally stored value
used for actually facetting.
A common practice among solr developers (so sayeth the solr mailing
list) for many use cases of this type is to pack both values into the
facet value "unique_id_1234:Sprockets". Then only the part after the
colon is actually displayed to the user. This is kind of hacky,
actually, but Solr doesn't have any unique special features for these
use cases, so it's what people use -- and even with this, a foreign
client in the SRU case would still need to know the application-specific
logic "Actually, only display the thing after the colon". Seems better
to put it in a displayTerm element, no?
This is pretty much the explanation in the original standard, "A string
to display to the end user in place of the term itself. ". Yep, that's
it. If people don't like that use case, I dunno, oh well. I think you
are right to think about 'scan' in relation to 'facetting', they are in
fact very similar operations, I've come to realize. A 'scan' is
essentially just a list of facets, but carried out over the entire
corpus, and where the user can choose alphabetically what point in the
entire list to begin. Contrariwise, a 'facetting' is really just a
'scan' within a certain set of search results, possibly with values
ordered by number of hits as a sort order. (I mean from the developer's
point of view; they may be perceived very differently by users, but
talking about implementation here, especially on the client end of an
api). It would make sense if your api's to both were as similar as
possible, since they are in fact such similar operations.
By the way, what the heck is the search-ws-comment listserv? It's for
discussing SRU? Am I the only one having trouble keeping track of where
people REALLY discuss SRU? What with a bunch of lists none of which
actually have "sru" in their title? (zng? huh?) The whole thing is
really confusing, if you guys want to actually welcome public viewing or
participation, you might want to figure out how to organize and
advertise yourselves a little better, including maybe some web presence
(you can't really find ANY of these lists googling). If you want to
instead have these discussions with a private cabal and then release the
spec when it's all done as a surprise, then carry on. Feel free to
forward this message to your other list if you like.
> Pretty much all the conversation on that list has been about changes to
> the facet response and the only controversial change is my desire to add
> a displayTerm.
> Here's a pointer to the achive for this month:
>> -----Original Message-----
>> From: SRU (Search and Retrieve Via URL) Implementors
>> [mailto:[log in to unmask]] On Behalf Of Jonathan Rochkind
>> Sent: Thursday, October 21, 2010 1:50 PM
>> To: [log in to unmask]
>> Subject: Re: <displayTerm> as a subelement of <term> in Scan responses
>> Can you link to the thread in the archives of the list, or is it (like
>> most of our lists, for no good reason) private?
>> I am curious what the arguments against it are. It seems like a good
>> idea to me?
>> But I do not use Scan at all.
>> I do not use facetting through SRU at all, but if/when I do, I believe
>> I'd use displayTerm if it was there.
>> LeVan,Ralph wrote:
>>> There's an overlong debate going on in the search-ws-comment mail
>> ([log in to unmask]<mailto:search-ws-
>> [log in to unmask]>) about including a displayTerm as a
>> subelement of <term> in a facet response. The feelings against
>> displayTerm are so strong as to suggest that it should be deprecated
> in Scan.
>>> I've been the one arguing for the inclusion of displayTerm for
> consistency with
>> Scan, but I don't use it myself in any of my implementations. So, my
> question for
>> you all is: do any of you actually use the displayTerm in your
> responses? If not,
>> I'll happily drop my arguments. If so, can you provide a good use