On Oct 15, 2007, at 5:54 PM, [EMAIL PROTECTED] wrote:

The generated NXQL query is

SELECT * FROM Document WHERE ecm:isCheckedInVersion = 0 AND fq:duree BETWEEN 2 AND 5

It works if the query is

... BETWEEN '2' AND '5'

I think that the field "duree" is indexed as a string but I don't know why.

Hello Fabien, this reminds me of a bug I fixed not long ago.
What your version (or svn revision)  of Nuxeo ?
You can try explicitely declaring your field as "int" in your Search Service contribution.

("resource" extension point)
<resource name="faq" prefix="fq" type="schema">
        <field name="duree" type="int" stored="true" indexed="true"/>
</resource>

If that doesn't work, we'll have to take a look at the DEBUG level logs


Yours,
GR


On 15 Oct 2007, at 10:28, [EMAIL PROTECTED] wrote:

> Hello,
>
> I have a schema called "faq" with a "duree" field :
> <xs:element name="duree" type="xs:integer"/>
>
> I have another schema called "faqsearch" :
> <xs:element name="dureemax" type="xs:integer"/>
>
> In a types-contrib.xml, I have :
> <extension target="org.nuxeo.ecm.core.schema.TypeService"
> point="schema">
>   <schema name="faq" src="schemas/faq.xsd" prefix="fq"/>
>   <schema name="faqsearch" src="schemas/faqsearch.xsd"
> prefix="fqsearch"/>
> </extension>
>
> and this FAQ document type :
> <extension target="org.nuxeo.ecm.core.schema.TypeService"
> point="doctype">
>   <doctype name="FAQ" extends="Document">
>     <schema name="common"/>
>     <schema name="dublincore"/>
>     <schema name="faq"/>
>   </doctype>
>
>   <doctype name="AdvancedSearchCustom" extends="Document">
>    <schema name="advanced_search" />
>    <schema name="faqsearch" />
>   </doctype>
> </extension>
>
> I indexed all fields with a nxsearch-contrib.xml file.

>
> I made a converter in an nxdocument.cpm.xml :
> <resource-property name="fq:duree" converter="int" store="yes"
> index="un_tokenized" />
>
> In a query-model.xml, I have :
> <queryModel name="ADVANCED_SEARCH" docType="AdvancedSearchCustom">
> ...
> <predicate parameter="fq:duree" operator="BETWEEN">
>   <field schema="faqsearch" name="dureemin" />
>   <field schema="faqsearch" name="dureemax" />
> </predicate>
> ...
>
> To finish, I modified the search_simpleform.xhtml with
> <t:inputText value="#{doc.faqsearch.dureemin}"
> styleClass="dataInput" />
> <t:inputText value="#{doc.faqsearch.dureemax}"
> styleClass="dataInput" />
>
>
> When I made a search
> SELECT * FROM Document WHERE fq:duree = '3' returns the document
> but if I
> entered an interval with the 2 text fields, there is no answer.
>
> Thank you.
>
> Fabien
>
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm
>

--
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87



_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

---------
Georges Racinet,   Nuxeo SAS
Open Source Enterprise Content Management (ECM)
Web: http://www.nuxeo.com/ and http://www.nuxeo.org/ - Tel: +33 1 40 33 79 87



_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to