Where should I be limiting my results?

前端 未结 1 1353
自闭症患者
自闭症患者 2021-01-28 06:09

What I have done is created an XML file with a list of several thousand search terms that I need to perform on a document. I then created this query, from a sample set of searc

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-28 06:27

    let $reults :=
    (
      let $pKeywords := ('best clients', 'Very', '20')
      return
        for $kw in $pKeywords
        return
        (
          /*/entry[contains(comment, concat('!', $kw))],
          /*/entry[contains(comment, $kw)]
        )
      [not(position() gt 2)]
    )
    for $i in (1 to count($results))
    return
    (
      subsequence($results/comment, $i, 1),
      subsequence($results/buyer, $i, 1)
    )
    

    Returns the correct solution:

    The client is only 20 years old.  Do not be surprised by his youth.
    
    Very personable.  One of our best clients.
    
    !Very difficult to reach, but one of our top buyers.
    
    A bit of an eccentric.  One of our best clients.
    
    

    0 讨论(0)
提交回复
热议问题