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

Searching a Solr colllection using the key value to get a specific file.

Guest
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

I'm trying to get migrate to solr, but have a question about using the record key in the search criteral
with Verity my code looks like this:
<cfsearch name="getPreDeleteInfo"
collection="#sttCFG.strCollectionName#"
type="simple"
status="info"
language="english"
criteria=" CF_KEY <CONTAINS> '#variables.criteria#'">

The record in the collection looks like:

[Record # 1]
AUTHOR: casjlr
CATEGORY: smm_doclibsecure
CATEGORYTREE: Web/
CONTEXT: [empty string]
CUSTOM1: office 2003 doc test
CUSTOM2: office 2003 doc test
CUSTOM3: [empty string]
CUSTOM4: Everyone_Intranet
KEY: D:\...\Web\Create_View_Delete_Calendar_Groups.doc
RANK: 1
RECORDSSEARCHED: 1
SCORE: 0.0000
SIZE: 76288
SUMMARY: Pick members from an Address Bookor Contacts list Create a calendar group based on the calendars that you are viewing Pick members from an Address Book or Contacts list In Calendar, on the Home tab, in the Manage Calendars group, click Calendar Groups, and then click Create New Calendar Group.  Create a calendar group based on the calendars that you are viewing In Calendar, on the Home tab, in the Manage Calendars group, click Calendar Groups, and then click Save as New Calendar Group.  Add ...
TITLE: office 2003 doc test
TYPE: application/msword
URL: body_emp.cfm?id=xx&action=RetrieveFile&ref=33&fp=/Create_View_Delete_Calendar_Groups.doc


An example of something that doens't work:

<cfsearch name="test" collection="test_solr "status="info" criteria='key:D*\...\Web\Create_View_Delete_Calendar_Groups.doc'>

Note: ... isn not the actual info (Didn't want to put my server actual path info in a public site)

I've tried a number of differnet combinations, but to no avail. Has anyone else successfully written a query like this?

Getting at the custom fields works fine.

<cfsearch name="test" collection="prodsite_smm_doclibsecure_solr "status="info" criteria='custom1:office 2003'> brings back the expected results.

Any help is appreciated.

TOPICS
Advanced techniques

Views

471

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 ,
Jul 05, 2011 Jul 05, 2011

Copy link to clipboard

Copied

In the Scheme.xml file I changed the key and URL fields to be indexed="true"

   <field name="key"     type="string" indexed="true" stored="true" required="true" />
   <field name="url"    type="string" indexed="true" stored="true" required="true" />

I can now do a search on the URL field as long as like put the wildcard * at the end of the search criteria, but I still do not get any results using the key field.  Any ideas how now to escape colons  : in the path name?

<cfsearch name="test" ="#sttCFG.strCollectionName#" status="info" criteria='url:body_emp.cfm?id=4735&action=RetrieveFile&ref=32356&fp=/Create_View_Delete_Calendar_Groups.doc*'>

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 ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

LATEST

OK, so I've figured out the syntax or querying the key field.  The criteria looks something like this:

criteria='key:"D:\\Inetpub\\FoldererName\\FolderName\\FolderName\\Create_View_Delete_Calendar_Groups.doc"'

*note that every '\' has been escaped to '\\'

Now say, I want to add additional criteria like documents that contain the word office, the criteria looks like this:

criteria='""key:"D:\\Inetpub\\FoldererName\\FolderName\\FolderName\\Create_View_Delete_Calendar_Groups.doc""" AND "+office"'\

What I really want to do though is limit the search do docments in a specific folder, something like

criteria='key:"D:\\Inetpub\\FoldererName\\FolderName\\FolderName\\*"'

I can't seem to get this to work.  I've read other posting saying wildcard searches need to be in lower case, and I've used lcase() around the string to force this, but still nothing is returned.

It's probalby a syntax issue, but I tried lots of variation with no success.

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