Skip navigation
TomO_STM_2010
Currently Being Moderated

Fix for SOLR searches beginning with wildcard?

Apr 17, 2012 9:26 AM

All, I am having problems finding clear answers on if the above was corrected in ColdFusion 10. 

 

I can't get my head around the idea of SOLR not allowing search criteria to begin with a wildcard.  I've seen a solution for reverse wildcard searching, which is great as long as I specify criteria for which I know the ending letters.  For example, if I am looking for all entries ending in "ing", I could do a search on "*ing", using the reverse wildcard to find "gni*".  I have yet to see, or come up with, a solution for a SOLR search with wildcards in the start and end of the criteria.  For example, lets say I am looking for any word with "fus" in the middle, such as "confusing" or "perfusing" or "profusely".  I would want to do a search such as "*fus*".  From what I understand thus far, this cannot be done in SOLR?

 

Thanks,

Tom

 
Replies
  • Currently Being Moderated
    Apr 29, 2012 11:48 PM   in reply to TomO_STM_2010

    ColdFusion will support whatever Apache solr supports as it is the underlying engine we are using.

    Solr technically disables support of leading wildcards by default in the traditional query parsers due to concerns about query performance since it tends to select a large percentage of indexed terms.

     

    Uday Ogra

    ColdFusion Engineering Team

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2012 12:57 AM   in reply to udayogra

    ColdFusion will support whatever Apache solr supports as it is the underlying engine we are using.

     

    And Solr does support it: http://lucene.apache.org/solr/api/org/apache/solr/analysis/ReversedWil dcardFilterFactory.html

     

    I think this is an egregious hack, but still, it's the way they've chosen to support it.

     

    Solr technically disables support of leading wildcards by default in the traditional query parsers due to concerns about query performance since it tends to select a large percentage of indexed terms.

     

    Be that as it may, this should be my decision, as the maintainer of the index, not your decision to blanketly disallow it.  If it's available, then one can use it if one choses, or not use it for the reasons you cite.  If you blanketly disallow it, you're removing the ability for me to make that decision.

     

    It's also a bit of a backwards compat issue, innit?  Verity allowed leading wildcards.

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2012 1:57 AM   in reply to Adam Cameron.

    If we google we can find hacks around it.

    And its not we who have decided to disallow it. It is Apache Solr's design.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2012 2:09 AM   in reply to udayogra

    If we google we can find hacks around it.

    And its not we who have decided to disallow it. It is Apache Solr's design.

     

    No, it's you who decided it by not integrating the wildcard filter as per my previous suggestion.

     

    Equally, if you chose to upgrade your inbuilt search engine, you should make sure it's backwards compatible with the one it's replacing.  You so often claim that backwards compat is your "holy grail", after all.  Lucene / Solr do also provide mechanisms to extend the base engine as much as you want, so simply wrapping up the baseline and going "[shrug]: it's Apache's fault" doesn't stand up to too much scrutiny.

     

    The functionality of the interface to Solr you expose via <cfindex> & <cfsearch> (etc) should have the same functionality - well: more, really - than that you provided for Verity.

     

    --

    Adam

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points