• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Filter solr <cfsearch> results

New Here ,
Jan 25, 2016 Jan 25, 2016

Copy link to clipboard

Copied

I am trying to filter search results within a solr search built in Coldfusion 10.

Apparently, the Coldfusion version of solr does not have the fq= (filter query) attribute, and I'm having trouble figuring out how to tell the search to only include records with a particular variable value.

<cfsearch name="getData" collection="MyCollection" criteria="#myCriteria# and custom1:#URL.myVariable#" maxrows="800" status="info" orderby="customvariable_s" contextBytes="80000" contextPassages="1" suggestions="always" />

I have stored a particular variable in "custom1" and want to search the collection using the criteria from a form (#myCriteria#), but only include items with the corresponding "custom1" value. Is there any way to do this?

Views

402

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2016 Jan 25, 2016

Copy link to clipboard

Copied

I believe that the Solr/CFSEARCH uses "+" instead of "AND", and will include "custom1:" as part of the search.

<cfsearch name="getData" collection="MyCollection" criteria="#myCriteria# + #URL.myVariable#" maxrows="800" status="info" orderby="customvariable_s" contextBytes="80000" contextPassages="1" suggestions="always" />


This _should_ work.  It's been a while since I have worked with Solr.


HTH,


^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2016 Jan 25, 2016

Copy link to clipboard

Copied

LATEST

Thank you for your reply. I tried using the plus sign, and while it does change the behavior of the search, it is still not working as intended. Now every search that I run returns the same 170 records. Other documentation suggests that "AND" is the correct syntax:

http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSe61e35da8d318518-1acb57941353e8b4f85-7ff9.h...

I also tried making my custom variable lowercase as suggested here, but nothing changes:

Adobe ColdFusion 10 * Search limitations

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation