That's very interesting. I dropped the flwor and used <extract-metadata> to get 
the titles instead and the order of the results returned is different. What is 
it about the two different methods (flwor vs. <extract-metadata>) that causes 
the order to change?

Thanks,
Maggie

From: Dave Cassel <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, October 28, 2014 2:05 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] Diacritic-insensitive collation ignored

Not sure, but perhaps running a flwor on the results of search:search is 
affecting the ordering. From the snippet you've shown, it looks like you're 
looping through to get the titles, which you could also do using 
<extract-metadata><http://docs.marklogic.com/guide/rest-dev/appendixb#id_94425>.
 If you drop the FLWOR and just look at the results from search:search, do you 
get the order you expect?

--
Dave Cassel
Developer Community Manager
MarkLogic Corporation<http://www.marklogic.com/>
Cell:  +1-484-798-8720


From: <Hasegawa>, Margarete 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, October 28, 2014 at 1:34 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Diacritic-insensitive collation ignored

Hi,

I'm working on an application that uses the Search API and I am trying to set 
the collation on an element range index to be diacritic insensitive. However, 
the same results are returned in the same order regardless of the collation 
that I use. We are using Marklogic 7. Has anyone encountered a similar problem 
before? If so, any thoughts on how to solve it?

Thanks,
Maggie

Here is the simplified version of the search:

declare variable $options :=
  <options xmlns="http://marklogic.com/appservices/search";>
      <constraint name="title">
      <word>
        <element ns="http://digital.library.ptsem.edu/ia"; name="title"/>
      </word>
    </constraint>
    <transform-results apply="empty-snippet"/>
    <operator name="sort">
     <state name="title">
       <sort-order xmlns="http://marklogic.com/appservices/search"; 
type="xs:string">
        <element ns="http://digital.library.ptsem.edu/ia"; name="sortTitle" 
collation="http://marklogic.com/collation/en/S1/AS/T0020"; />
       </sort-order>
     </state>
    </operator>
  </options>;
let $response:= search:search("title:Viage literario", $options, 1, 500)
let $total := $response/@total
for $result in $response/search:result
let $uri := $result/@uri
let $doc := fn:doc($uri)
let $title := $doc/ia:doc/ia:metadata/ia:sortTitle
let $vol := $doc/ia:doc/ia:metadata/ia:volumeInfo/ia:volume
Return fn:string($title)

Here are the results that I am seeing:

Viage literario á iglesias de España
Viage literario á iglesias de España
Viage literario á iglesias de España
Viage literario á iglesias de España
Viage literario a las iglesias de Espana
Viage literario á iglesias de España
Viage literario a las iglesias de Espana
Viage literario á iglesias de España
Viage literario á iglesias de España : Le Publica con algunas observaciones
Viage literario á iglesias de España
Viage literario a las iglesias de Espana
Viage literario á iglesias de España
Viage literario a las iglesias de Espana
Viage literario a las iglesias de Espana
Viage literario a las iglesias de Espana
Viage literario a las iglesias de Espana
Viage literario a las iglesias de Espana

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to