Hi Ahmet, Thank you for your idea, very helpful. I can indeed get tf values through the tf and ttf function queries.
Since tf uses Similarity, I'm getting back some floats (i.e. "dog occurs 1.424 times"), when I was expecting ints. Is there a way to get back ints (simple word count)? Thanks, Aki On Wed, Feb 4, 2015 at 3:41 PM, Ahmet Arslan <iori...@yahoo.com.invalid> wrote: > Hi Aki, > > How about tf function query? > https://cwiki.apache.org/confluence/display/solr/Function+Queries > > Ahmet > > > > On Wednesday, February 4, 2015 7:59 PM, Aki Balogh <a...@marketmuse.com> > wrote: > I'm using solr TermVectorComponent to get term frequencies for specific > terms in a corpus. I.e. I query for "q=dog" and want to get back term > frequencies for "dog" in the corpus. > > However, when I request term frequencies, I get back ALL term frequencies > for ALL matching documents, which is generating a massive response and > wasting I/O. > > Instead, I would like to get tf for ONLY the terms that are an exact match > to the term in my query. > > Word count like this seems like it would be a common use case, but I didn't > see it in the code. > > http://grepcode.com/file_/repo1.maven.org/maven2/org.dspace.dependencies.solr/dspace-solr-core/1.4.0.1/org/apache/solr/handler/component/TermVectorComponent.java#78 > > Is there a way to get this behavior without having to modify the source > code? > > Thanks, > Aki >