Hello,

you should always try to avoid searches with prefix '*' : prefix
wildcard searches blow up (slow and OOM risks) in inverted indexes
like Lucene is. I don't completely see why you are combining
s:property-contains and s:propsearch: I think you should only use the
latter. Now, assume you want to boost matches in the title, en you
search for 'the lazy fox', then make sure you search is something
like:

<d:or>
     <s:propsearch>
          <d:prop><h:title/></d:prop>
          <d:literal>the^10 lazy^10 fox^10</d:literal>
     </s:propsearch>
     <d:contains>the lazy fox</d:contains>
</d:or>

Now, matches in a title are boosted. If you would have also:

<d:or>
     <d:eq>
          <d:prop><h:title/></d:prop>
          <d:literal>the lazy fox</d:literal>
     </d:eq>
     <s:propsearch>
          <d:prop><h:title/></d:prop>
          <d:literal>the^10 lazy^10 fox^10</d:literal>
     </s:propsearch>
     <d:contains>the lazy fox</d:contains>
</d:or>

then the score for exact titles are even higher. Hope this helps,

regards Ard

On Tue, Jun 1, 2010 at 5:33 PM, abamhaoudi <[email protected]> wrote:
>
>  I have search query whith  a special situation:
>
>  if the search query matches or contanis the title of a document then the
> score value schould be higher than in the body of the rest of this document:
>  <#if searchoptions.isSearchInContent()>
> <d:and>
>           <s:property-contains>
>               <d:prop><h:title></d:prop>
>                    <d:literal>${searchOptions.searchQuery}</d:literal>
>                        </<s:property-contains>
>       </d:and>
>              <s:propsearch>
>                            <d:prop><h:title/></d:prop>
>
> <d:literal>*${searchOptions.searchQuery}*^8</d:literal>
>                        </s:propsearch>
> <#else>
> <s:propsearch>
>                            <d:prop><h:title/></d:prop>
>
> <d:literal>*${searchOptions.searchQuery}*^1</d:literal>
>                        </s:propsearch>
>
>
>
> ...
>
> Thnaks in advanced
>
>
>
> --
> View this message in context: 
> http://old.nabble.com/complex-dasl-query-tp28743656p28743656.html
> Sent from the Hippo CMS development public mailinglist mailing list archive 
> at Nabble.com.
>
> ********************************************
> Hippocms-dev: Hippo CMS 6 development public mailinglist
>
> Searchable archives can be found at:
> MarkMail: http://hippocms-dev.markmail.org
> Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
>
>
********************************************
Hippocms-dev: Hippo CMS 6 development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to