cancel
Showing results for 
Search instead for 
Did you mean: 

lucene search on custom attribute

wciesiel
Champ in-the-making
Champ in-the-making
Hi,

I've created custom model (<namespace uri="custom.model" prefix="custom"/>)with such an aspect:

<aspects>
    <aspect name="custom:article">
      <title>Someco Webable</title>
      <properties>
        <property name="custom:ReleaseDate">
          <title>Released Date</title>
          <type>d:date</type>
        </property>
        <property name="custom:Internal">
          <type>d:boolean</type>
          <default>true</default>
        </property>
      </properties>
    </aspect>
  </aspects>

I am trying to create webscript returning all articles within certain path in the repository with certain value of boolean parameter custom:Internal. How can I achieve this? I am trying something like


var query = "PATH:\"/app:company_home/cm:Articles//*\" AND TYPE:\"{custom.model}pressrelease\"" +
" AND @custom\:Internal:\"true\"";

but it's not working Smiley Sad
3 REPLIES 3

rivarola
Champ on-the-rise
Champ on-the-rise
Hello,

Did you try this search expression in the NodeBrowser first ?
This is a good way to test & debug lucene queries before espaping them in JS or FTL.

wciesiel
Champ in-the-making
Champ in-the-making
Hello,

Did you try this search expression in the NodeBrowser first ?
This is a good way to test & debug lucene queries before espaping them in JS or FTL.

No, I didn't. I'll certainly try (as soon as I find that NodeBrowser). But is your question caused by the the fact that my query SHOULD work?

If not - what is the proper syntax for querying custom attributes in lucene searches?

TIA

Wojtek

eyestreet
Champ in-the-making
Champ in-the-making
You should escape the first \ like this:

@custom\\:Internal:\"true\""