(Forwarded to the list.)

From: [EMAIL PROTECTED]
Hello,

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.

This is my nxsearch-contrib.xml :


<?xml version="1.0"?>

<component name="org.nuxeo.formation.Search">

 <extension
 target="org.nuxeo.ecm.core.search.service.SearchServiceImpl"
 point="indexableDocType">
 <indexableDocType indexAllSchemas="true" name="FAQ" />
</extension>

 <extension
 target="org.nuxeo.ecm.core.search.service.SearchServiceImpl"
 point="resource">
 <resource name="faq" prefix="fq" type="schema" indexAllFields="true">
 </resource>
</extension>

 <extension
 target="org.nuxeo.ecm.core.search.service.SearchServiceImpl"
 point="fullTextField">
<fullText name="ecm:fulltext" analyzer="default" blobExtractorName="nuxeoTransform">
  <field sortable="true">dublincore:title</field>
  <field sortable="true">dublincore:description</field>
  <field sortable="true">dublincore:rights</field>
  <field sortable="true">dublincore:format</field>
  <field sortable="true">dublincore:subjects</field>
  <field sortable="true">dublincore:source</field>
  <field sortable="true">dublincore:language</field>

   <field sortable="true">faq:question</field>
  <field sortable="true">faq:reponse</field>
  <field sortable="true">faq:duree</field>

   <mimetype name=".*/.*">any2text</mimetype>
 </fullText>
</extension>

</component>


And duree is defined to be and integer in the schema ...


Thank you.


Florent Guillaume <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
15/10/2007 14:38 ZE2

To   [EMAIL PROTECTED]
cc   [email protected]
bcc
Subject   Re: [Ecm] Problem with search UI


Please provide your NXQL request that fails to return documents.
Also please check the DEBUG logs for information about the processing
of that request.

Florent

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


--
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

Reply via email to