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 "Grant Ingersoll (JIRA)" <ji...@apache.org> on 2008/11/24 16:39:44 UTC
[jira] Created: (SOLR-877) Access to Lucene's TermEnum capabilities
Access to Lucene's TermEnum capabilities
----------------------------------------
Key: SOLR-877
URL: https://issues.apache.org/jira/browse/SOLR-877
Project: Solr
Issue Type: New Feature
Reporter: Grant Ingersoll
Assignee: Grant Ingersoll
Priority: Minor
I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Matt Weber (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707601#action_12707601 ]
Matt Weber commented on SOLR-877:
---------------------------------
I wrote a patch for freq. sorting thar is attached to SOLR-1156. I will update that patch once you commit your latest changes.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653189#action_12653189 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Noble: would optionally using something like a radix tree change the external interface? That's what we should be focused most on now in order to enable seamlessly adding optimizations in the future.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653187#action_12653187 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
lol - didn't take too long for other faceting like features to pop up (i.e. facet.mincount).
We really should reuse the facet interface terminology here: limit, mincount, etc.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707667#action_12707667 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Hmmm, looking at the wiki examples, I think there are some more quick improvements we can do...
>From the wiki:
bq. To use in auto-suggest, add in a lower bound, an upper bound and make the lower bound exclusive of the input term, as in: http://localhost:8983/solr/terms?terms.fl=name&terms.lower=at&terms.prefix=at&terms.lower.incl=false&terms.upper=b&indent=true
Unless I'm missing something, it doesn't make sense to exclude the lower bound... seems like it would often be useful to know if what the user typed in matched a term in the index.... excluding it would lead one to believe that it doesn't exist.
But the improvement is that one should simply be able to specify a prefix:
http://localhost:8983/solr/terms?terms.fl=name&terms.prefix=at
The rest should be implementation details in Solr to make it efficient (i.e. Solr should know to start at "at" in the TermEnum if that's the prefix.)
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653201#action_12653201 ]
Noble Paul commented on SOLR-877:
---------------------------------
autosuggest is a very commonly used feature. And when they are used , the hits are just too many.
we can add extra options to optimize or not (say memTree=true/false).
If the option is set we can build a the data structure . Potentially this tree can consume a lot of memory if there are too many terms . Users must have an option to turn it off.
The feature may be added with faceting component or the TermComponent. The problem here is that these components are already overloaded.with features. Adding this small option into these can cause more confusion.
IMHO we should not pack too many features into one component unless we are sure that they are mostly used together. (For instance faceting and autosuggest are rarely done as a part of one request ).It would be better to write separate components for each functionality . Internally the components can share code and the users can mix and match if they need to
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Khee Chin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652603#action_12652603 ]
kheechin edited comment on SOLR-877 at 12/2/08 4:12 PM:
---------------------------------------------------------
As a solr-user who uses this function for auto-complete, I'd like to filter out terms with a low-frequency count. Thus, I've implemented a quick-hack, against a 28th Nov checkout.
{code:title=/src/java/org/apache/solr/common/params/TermsParams.java|borderStyle=solid}
// Optional. The minimum value of docFreq to be returned. 1 by default
public static final String TERMS_FREQ_MIN = TERMS_PREFIX + "freqmin";
// Optional. The maximum value of docFreq to be returned. -1 by default means no boundary
public static final String TERMS_FREQ_MAX = TERMS_PREFIX + "freqmax";
{code}
{code:title=/src/java/org/apache/solr/handler/component/TermsComponent.java|borderStyle=solid}
// At lines 55-56, after initializing boolean upperIncl and lowerIncl
int freqmin = params.getInt(TermsParams.TERMS_FREQ_MIN,1); // initialize freqmin
int freqmax = params.getInt(TermsParams.TERMS_FREQ_MAX,-1); // initialize freqmax
// At line 69, replacing terms.add(theText, termEnum.docFreq());,
if (termEnum.docFreq() >= freqmin && (freqmax==-1 || (termEnum.docFreq() <= freqmax))) {
terms.add(theText, termEnum.docFreq());
} else {
i--;
}
{code}
The new parameters could be used by calling
terms.freqmin=<value>
terms.freqmax=<value>
both of which, are optional.
was (Author: kheechin):
As a solr-user who uses this function for auto-complete, I'd like to filter out terms with a low-frequency count. Thus, I've implemented a quick-hack, against a 28th Nov checkout.
/src/java/org/apache/solr/common/params/TermsParams.java
// Optional. The minimum value of docFreq to be returned. 1 by default
public static final String TERMS_FREQ_MIN = TERMS_PREFIX + "freqmin";
// Optional. The maximum value of docFreq to be returned. -1 by default means no boundary
public static final String TERMS_FREQ_MAX = TERMS_PREFIX + "freqmax";
/src/java/org/apache/solr/handler/component/TermsComponent.java
// At lines 55-56, after initializing boolean upperIncl and lowerIncl
int freqmin = params.getInt(TermsParams.TERMS_FREQ_MIN,1); // initialize freqmin
int freqmax = params.getInt(TermsParams.TERMS_FREQ_MAX,-1); // initialize freqmax
// At line 69, within the if() { terms.add() } block,
if (termEnum.docFreq() >= freqmin && (freqmax==-1 || (termEnum.docFreq() <= freqmax))) {
terms.add(theText, termEnum.docFreq());
} else {
i--;
}
The new parameters could be used by calling
terms.freqmin=<value>
terms.freqmax=<value>
both of which, are optional.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651607#action_12651607 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
It's not about duplicating effort (implementation), it's about reusing interface conventions, and what makes the most sense.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653207#action_12653207 ]
Noble Paul commented on SOLR-877:
---------------------------------
No changes in the TermComponent API (I mean the HTTP API).
May be a config param (in solrconfig.xml)
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654104#action_12654104 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
Committed revision 723985. Thanks, Khee! I slightly changed the patch to use "mincount" and "maxcount" per Yonik's suggestion to overlap w/ faceting.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654066#action_12654066 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
bq. lol - didn't take too long for other faceting like features to pop up (i.e. facet.mincount).
We really should reuse the facet interface terminology here: limit, mincount, etc.
Yeah, Yonik, I'm starting to think of this as Term Faceting. ;-) I still like rows better than limit, but will change Khee's params to be mincount and maxcount
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-877) Access to Lucene's TermEnum capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yonik Seeley updated SOLR-877:
------------------------------
Attachment: SOLR-877_2.patch
I've been reviewing some interfaces in prep for the 1.4 release.... Here's a patch to this request handler:
- fixes the labels for non-text fields (makes them human readable)
- adds a terms.raw parameter just in case you really do want the raw internal indexed form of the term
- changes terms.rows to terms.limit to match faceting (as predicted, people want to sort by freq too, so this is much closer to faceting than anything else)
- changes the name of the request handler in the example schema to the more generic /terms (from /autoSuggest). I could see this becoming a standard useful request handler, and limiting it to /autoSuggest doesn't sound right
I'll commit shortly barring objections.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707677#action_12707677 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Found another bug: null pointer exception if you try a term enum past the end of the index (where lucene will return null from the term enum):
http://localhost:8983/solr/terms?terms.fl=zzz_s
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-877) Access to Lucene's TermEnum capabilities
Posted by "Khee Chin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Khee Chin updated SOLR-877:
---------------------------
Attachment: SOLR-877.patch
As req, however, I have only done a single test case, but it should be trivial to add on more test cases in future.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651609#action_12651609 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
The field thing makes sense, too. I thought about it and originally decided against it to avoid having to ever go to deep into nested NamedLists, but in hindsight, it does make sense to be able to send in multiple fields, which means we can keep the terms.fl param.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652623#action_12652623 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
Can you supply as a patch with some simple unit tests?
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Khee Chin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652603#action_12652603 ]
Khee Chin commented on SOLR-877:
--------------------------------
As a solr-user who uses this function for auto-complete, I'd like to filter out terms with a low-frequency count. Thus, I've implemented a quick-hack, against a 28th Nov checkout.
/src/java/org/apache/solr/common/params/TermsParams.java
// Optional. The minimum value of docFreq to be returned. 1 by default
public static final String TERMS_FREQ_MIN = TERMS_PREFIX + "freqmin";
// Optional. The maximum value of docFreq to be returned. -1 by default means no boundary
public static final String TERMS_FREQ_MAX = TERMS_PREFIX + "freqmax";
/src/java/org/apache/solr/handler/component/TermsComponent.java
// At lines 55-56, after initializing boolean upperIncl and lowerIncl
int freqmin = params.getInt(TermsParams.TERMS_FREQ_MIN,1); // initialize freqmin
int freqmax = params.getInt(TermsParams.TERMS_FREQ_MAX,-1); // initialize freqmax
// At line 69, within the if() { terms.add() } block,
if (termEnum.docFreq() >= freqmin && (freqmax==-1 || (termEnum.docFreq() <= freqmax))) {
terms.add(theText, termEnum.docFreq());
} else {
i--;
}
The new parameters could be used by calling
terms.freqmin=<value>
terms.freqmax=<value>
both of which, are optional.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-877) Access to Lucene's TermEnum capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll updated SOLR-877:
---------------------------------
Attachment: SOLR-877.patch
First draft
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Attachments: SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yonik Seeley reassigned SOLR-877:
---------------------------------
Assignee: Yonik Seeley (was: Grant Ingersoll)
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Yonik Seeley
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651715#action_12651715 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
bq. It's not about duplicating effort (implementation), it's about reusing interface conventions, and what makes the most sense.
True, I see what you mean. For some reason, though, I tend to think of TermEnum in the terms of lower bound and upper bound instead of offset, b/c offset implies you are a certain number of items into an array (i.e. foo[10]), whereas lower bound just feels looser to me. Semantics, I know. As for term.limit, isn't that faceting duplicating the "rows" parameter?
----
I just committed several changes:
- Added terms.prefix so now the auto-suggest should be possible. See the Wiki for an example
- Changed upr.incl -> upper.incl and lwr.incl -> lower.incl
- Fixed a but w/ lower.incl = false that skipped the next term even if the first term was not a match for the input lower bound term.
Committed revision 721681.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651598#action_12651598 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Looks useful, esp for distributed idf when we get around to it.
A quick review:
- "terms.fl", fl normally stands for field list. Would this make more sense as "terms.f"?
- strings are returned instead of integers for the term count (it's even more obvious in JSON output)
- how does one ask for "all terms after foo?" the docs suggest that upper or rows *must* be set... is the only way to set a really high rows value? If so, allowing terms.rows=-1 for "unlimited" might be nicer.
Actually, this is very much like faceting.... perhaps we should use the same parameters:
terms.field
terms.offset
terms.limit
terms.mincount (future)
terms.sort (future)
If this is to be useful for distributed search, it needs to be able to handle the direct specifications of terms in multiple fields. We necessarily need to implement this now, but we should think about having an output format that doesn't need to be deprecated when it is added. At a minimum it seems like there should be an extra level.... something like
{code}
"terms" = {
"myfield" = { "foo"=10, "bar"=5, ...}
}
{code}
Or if we want to get even more like faceting with the output:
{code}
"terms" = {
"fields" = {
"myfield" = {"foo"=10,...}
}
}
{code}
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654118#action_12654118 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
bq. Does every param need to be consistent?
No... there's certainly no mandate... "rows" and "facet.limit" are established enough now that neither should be changed IMO.
It just seems like more consistency rather than less generally seems like a good thing, balanced with other factors of course. It also affects usability - if people think about this more like faceting, they are more likely to quickly type terms.limit by mistake.
Of course these things are aesthetic and subjective - would be nice to hear from someone else on preferences before a release.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707729#action_12707729 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
OK, I just committed a fix for the null pointer exceptions, changed to use intern'd comparisons, and a little restructuring. Hopefully that's it.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Yonik Seeley
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653184#action_12653184 ]
Noble Paul commented on SOLR-877:
---------------------------------
We may need a faster solution for the autoSuggest feature.
This can be quite slow because we are doing a string compare for each string .Considering the fact that autoSuggest gets TOO MANY hits in a typical website it should not be doing so much of processing
We must use something like this http://en.wikipedia.org/wiki/Radix_tree to make it efficient and build the tree in the beginning (and after every commit).
SOLR-706 can be closed if that is included
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll resolved SOLR-877.
----------------------------------
Resolution: Fixed
Committed revision 721491.
This commit is slightly different from the last patch. Fixed a couple of minor issues and added the ability to exclude the lower bound.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-877) Access to Lucene's TermEnum capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll updated SOLR-877:
---------------------------------
Fix Version/s: 1.4
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651598#action_12651598 ]
yseeley@gmail.com edited comment on SOLR-877 at 11/28/08 8:45 AM:
-------------------------------------------------------------
Looks useful, esp for distributed idf when we get around to it.
A quick review:
- "terms.fl", fl normally stands for field list. Would this make more sense as "terms.f"?
- strings are returned instead of integers for the term count (it's even more obvious in JSON output)
- how does one ask for "all terms after foo?" the docs suggest that upper or rows *must* be set... is the only way to set a really high rows value? If so, allowing terms.rows=-1 for "unlimited" might be nicer.
Actually, this is very much like faceting.... perhaps we should use the same parameters:
terms.field
terms.offset
terms.limit
terms.mincount (future)
terms.sort (future)
If this is to be useful for distributed search, it needs to be able to handle the direct specifications of terms in multiple fields. We necessarily need to implement this now, but we should think about having an output format that doesn't need to be deprecated when it is added. At a minimum it seems like there should be an extra level.... something like
{code}
"terms" = {
"myfield" = { "foo"=10, "bar"=5, ...}
}
{code}
Or if we want to get even more like faceting with the output:
{code}
"terms" = {
"fields" = {
"myfield" = {"foo"=10,...}
}
}
{code}
- "terms.upr.incl" and "terms.lwr.incl" hurt the eyes a little since we already have "lower" and "upper" in the names of other terms - seems error prone (but this is a purely aesthetic thing).
- This is supposedly useful for auto suggest - how do I go about asking for all terms starting with "abc"? Shouldn't there be a "terms.prefix" (just like faceting)?
was (Author: yseeley@gmail.com):
Looks useful, esp for distributed idf when we get around to it.
A quick review:
- "terms.fl", fl normally stands for field list. Would this make more sense as "terms.f"?
- strings are returned instead of integers for the term count (it's even more obvious in JSON output)
- how does one ask for "all terms after foo?" the docs suggest that upper or rows *must* be set... is the only way to set a really high rows value? If so, allowing terms.rows=-1 for "unlimited" might be nicer.
Actually, this is very much like faceting.... perhaps we should use the same parameters:
terms.field
terms.offset
terms.limit
terms.mincount (future)
terms.sort (future)
If this is to be useful for distributed search, it needs to be able to handle the direct specifications of terms in multiple fields. We necessarily need to implement this now, but we should think about having an output format that doesn't need to be deprecated when it is added. At a minimum it seems like there should be an extra level.... something like
{code}
"terms" = {
"myfield" = { "foo"=10, "bar"=5, ...}
}
{code}
Or if we want to get even more like faceting with the output:
{code}
"terms" = {
"fields" = {
"myfield" = {"foo"=10,...}
}
}
{code}
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-877) Access to Lucene's TermEnum capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll updated SOLR-877:
---------------------------------
Comment: was deleted
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653202#action_12653202 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Regardless of how optimizations are selected or turned on/off, do you see anything in the current API that we should change now to enable optimization later (or now for all I care). I'm only asking about the API.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654110#action_12654110 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
bq. So are you advocating deprecating facet.limit and adding facet.rows,
or that aligning the APIs doesn't matter in this case?
I don't know. Does every param need to be consistent? If that is the case, then I guess we should either decide on rows or limit across all of them.
Otherwise, I mean, all of these end up having a prefix attached to them (i.e. terms.rows), so it may not be a big deal, either. I'm fine either way, I guess. Your call.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654102#action_12654102 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
bq. I still like rows better than limit,
So are you advocating deprecating facet.limit and adding facet.rows,
or that aligning the APIs doesn't matter in this case?
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651717#action_12651717 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
For the purposes of this component, I think of TermEnum as an implementation, not the interface.... people will eventually want to do things like sort by high docfreq (just as in faceting), or only list terms above a certain count, or only list terms matching a certain pattern, etc. All of these can make sense since we can do it more efficiently closer to the data.
bq. I tend to think of TermEnum in the terms of lower bound and upper bound instead of offset
Right, offset doesn't make as much sense with the current semantics (but it might later).
bq. As for term.limit, isn't that faceting duplicating the "rows" parameter?
Yes, we unfortunately have two ways of specifying this ("rows" and "limit"). I think limit is the better name though (and this will be highly associated with faceting in people's mind I think).
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707723#action_12707723 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
bq. Unless I'm missing something, it doesn't make sense to exclude the lower bound... seems like it would often be useful to know if what the user typed in matched a term in the index.... excluding it would lead one to believe that it doesn't exist.
I think excluding the lower bound allows you to get the _next_ item for suggestion, but I suppose it is up to the app to decide whether they want to confirm the existing word, or just suggest what could come next.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Yonik Seeley
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll reopened SOLR-877:
----------------------------------
Yeah, it is sort of like faceting, but I didn't want to get too close to it, otherwise we're just duplicating effort. I wanted it to be really lightweight. We can add the pieces suggested here. I'll switch to int output right now.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651712#action_12651712 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
bq. This is supposedly useful for auto suggest - how do I go about asking for all terms starting with "abc"? Shouldn't there be a "terms.prefix" (just like faceting)?
You put in a lower bound of "abc"
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-877) Access to Lucene's TermEnum capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll updated SOLR-877:
---------------------------------
Attachment: SOLR-877.patch
This is close to ready to commit.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651713#action_12651713 ]
Erik Hatcher commented on SOLR-877:
-----------------------------------
Do note that suggestions using this component will be across the entire index, not confined with q/fq constraints. For that capability, look to the facet.prefix feature of the facet component.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654134#action_12654134 ]
Noble Paul commented on SOLR-877:
---------------------------------
bq.have you done any performance testing of this approach versus the radix tree (or other tree/trie approaches)?
I haven't done a perf comparison. But , it occurred to me as I looked at the code .It goes through each Term one by one and does a startsWith()
It can be quite expensive for large no:of Terms
Memory consumption can be a problem.
That is why I suggested a config param. User can make a call as to whether he wants to pay that price and he can afford that.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651604#action_12651604 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
Fixed the int issue.
Committed revision 721534.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654164#action_12654164 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
{quote}
Another thought I'll just throw out there w/o advocating: could this just be a faceting optimization?
If the faceting base query is :, and one can ignore deleted docs, then the facet counts are equivalent to the term df here. So this could be implemented as an optimization to faceting w/ the addition of a facet.ignoreDeletes parameter. Then the distributed part would already be done (once facet.sort=false is implemented for distributed search).
{quote}
Hmmm, probably true. I tend to think of this as pretty lightweight, but I see no reason not to make your suggested changes in the facet code either.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Ingersoll resolved SOLR-877.
----------------------------------
Resolution: Fixed
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654103#action_12654103 ]
Grant Ingersoll commented on SOLR-877:
--------------------------------------
Noble, have you done any performance testing of this approach versus the radix tree (or other tree/trie approaches)?
AIUI, if you do the tree approach, doesn't that mean you need to build the tree from all of the terms in a given field? And then what about if you want to go across multiple fields? Seems like that would be a pretty large footprint. In some sense, the Term dictionary in Lucene is already very similar to this structure, except it can't do the character matching like you are proposing (but it does very efficiently encodes the terms)
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707661#action_12707661 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Committed latest changes, will update wiki shortly.
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch, SOLR-877_2.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-877) Access to Lucene's TermEnum
capabilities
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654120#action_12654120 ]
Yonik Seeley commented on SOLR-877:
-----------------------------------
Another thought I'll just throw out there w/o advocating: could this just be a faceting optimization?
If the faceting base query is *:*, and one can ignore deleted docs, then the facet counts are equivalent to the term df here. So this could be implemented as an optimization to faceting w/ the addition of a facet.ignoreDeletes parameter. Then the distributed part would already be done (once facet.sort=false is implemented for distributed search).
> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>
> Key: SOLR-877
> URL: https://issues.apache.org/jira/browse/SOLR-877
> Project: Solr
> Issue Type: New Feature
> Reporter: Grant Ingersoll
> Assignee: Grant Ingersoll
> Priority: Minor
> Fix For: 1.4
>
> Attachments: SOLR-877.patch, SOLR-877.patch, SOLR-877.patch
>
>
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's TermEnum capabilities. I think this will be useful for doing auto-suggest and other term based operations. My first draft is not distributed, but it probably should be made to do so eventually.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.