You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Ryan McKinley (JIRA)" <ji...@apache.org> on 2010/01/04 05:10:57 UTC
[jira] Created: (SOLR-1694) DocFrequencyValueSource
DocFrequencyValueSource
-----------------------
Key: SOLR-1694
URL: https://issues.apache.org/jira/browse/SOLR-1694
Project: Solr
Issue Type: New Feature
Components: search
Reporter: Ryan McKinley
Priority: Minor
A ValueSource to expose the document frequency for a given field.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-1694) DocFrequencyValueSource
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan McKinley updated SOLR-1694:
--------------------------------
Attachment: SOLR-1694-DocFrequencyValueSource.patch
This is a first draft, it gets the DF with:
{code:java}
public DocValues getValues(Map context, final IndexReader reader) throws IOException
{
final String[] arr = cache.getStrings(reader, field);
return new DocValues() {
public int intVal(int doc)
{
try {
int v = reader.docFreq( new Term( qfield, arr[doc] ) );
//System.out.println( "DF("+arr[doc]+":"+v );
return v;
}
catch (IOException e) {
e.printStackTrace();
}
return 0;
}
{code}
You call the function with:
{code}
http://localhost:3456/solr/select?q=*:*&sort=df(id,links) desc
{code}
NOTE: right now this only works with string fields
> DocFrequencyValueSource
> -----------------------
>
> Key: SOLR-1694
> URL: https://issues.apache.org/jira/browse/SOLR-1694
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Ryan McKinley
> Priority: Minor
> Attachments: SOLR-1694-DocFrequencyValueSource.patch
>
>
> A ValueSource to expose the document frequency for a given field.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1694) DocFrequencyValueSource
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796079#action_12796079 ]
Ryan McKinley commented on SOLR-1694:
-------------------------------------
I don't know if folks think this is generally useful... if yes, then I would love feedback and move forward on commiting.
If not, i can just use it as a plugin
> DocFrequencyValueSource
> -----------------------
>
> Key: SOLR-1694
> URL: https://issues.apache.org/jira/browse/SOLR-1694
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Ryan McKinley
> Priority: Minor
> Attachments: SOLR-1694-DocFrequencyValueSource.patch
>
>
> A ValueSource to expose the document frequency for a given field.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1694) DocFrequencyValueSource
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796071#action_12796071 ]
Ryan McKinley commented on SOLR-1694:
-------------------------------------
The use case (mine anyway) is for implementing a Graph structure with Documents.
Consider three documents:
{code}
id: A
links: B
links: C
{code}
{code}
id: B
links: C
{code}
{code}
id: C
{code}
Now, i need to find the documents with the most links. That is:
A = 0
B = 1 (A)
C = 2 (A and B)
> DocFrequencyValueSource
> -----------------------
>
> Key: SOLR-1694
> URL: https://issues.apache.org/jira/browse/SOLR-1694
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Ryan McKinley
> Priority: Minor
>
> A ValueSource to expose the document frequency for a given field.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.