Hi,
    I have added the below query for boosting if a match is found inside an 
element
<additional-query xmlns="http://marklogic.com/appservices/search";>
                                                {
                                                    cts:or-query((
                                                        cts:and-query(()),
                                                            
cts:element-word-query(xs:QName("title"),$search-term,(),$weight)))
                                                   }     
                                                </additional-query>

But i have a problem here. Whatever be the weight am giving, the score is only 
decreasing, not increasing at all.
Can anybody let me know the reason.

Thanks,
Diwakar N


________________________________________
From: general-boun...@developer.marklogic.com 
<general-boun...@developer.marklogic.com> on behalf of 
general-requ...@developer.marklogic.com 
<general-requ...@developer.marklogic.com>
Sent: 11 December 2014 20:53
To: general@developer.marklogic.com
Subject: General Digest, Vol 126, Issue 20

Send General mailing list submissions to
        general@developer.marklogic.com

To subscribe or unsubscribe via the World Wide Web, visit
        http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        general-requ...@developer.marklogic.com

You can reach the person managing the list at
        general-ow...@developer.marklogic.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. automatically replace host in cluster (Muth, John, Springer UK)
   2. Boosting score using additional query
      (diwakar.narayanasw...@wipro.com)
   3. Re: Boosting score using additional query (Peter Kester)
   4. Re: Boosting score using additional query (Erik Hennum)
   5. Re: automatically replace host in cluster (Ron Hitchens)


----------------------------------------------------------------------

Message: 1
Date: Thu, 11 Dec 2014 10:30:16 +0000
From: "Muth, John, Springer UK" <john.m...@springer.com>
Subject: [MarkLogic Dev General] automatically replace host in cluster
To: "general@developer.marklogic.com"
        <general@developer.marklogic.com>
Message-ID:
        <4b0a77ae40e60640bebba331b8e159316e264...@senldogo0752.springer-sbm.com>

Content-Type: text/plain; charset="us-ascii"


Hello,

I'm considering writing some XQuery to automatically update the configuration 
of a cluster where one host has died and you want to replace it with a new one.
We already have scripts in place that automatically configure the new host, and 
join it to the cluster.
The bit we're missing is updating the forests, to make it so the forests that 
were previously on the now-dead host are instead on the replacement host.
I'm imagining a new script/endpoint that would be something like:

/move-forests?old-host=dead-host.domain.com&new-host=replacement-host.domain.com

It looks like it should be fairly straightforward to do using existing admin: 
functions, something like:

 - for each database,
    - for each forest
       - if on dead host
       - copy to new host and delete from dead host

 - delete dead host

Does this sound reasonable?
Has anybody done this kind of thing?
Any gotchas, etc?

Thanks,
John



------------------------------

Message: 2
Date: Thu, 11 Dec 2014 14:50:32 +0000
From: <diwakar.narayanasw...@wipro.com>
Subject: [MarkLogic Dev General] Boosting score using additional query
To: <general@developer.marklogic.com>
Message-ID: <1418309432059.35...@wipro.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

    I am using search:search with lot of additional queries in options. Will i 
be able to boost the score, if the match is found inside a particular element 
of a document using an additional query? Do i need to have document quality set 
for this to work?


Thanks,

Diwakar N


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://developer.marklogic.com/pipermail/general/attachments/20141211/1357c84a/attachment-0001.html

------------------------------

Message: 3
Date: Thu, 11 Dec 2014 15:06:43 +0000
From: Peter Kester <peter.kes...@marklogic.com>
Subject: Re: [MarkLogic Dev General] Boosting score using additional
        query
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Message-ID: <d0af6317.1947f%peter.kes...@marklogic.com>
Content-Type: text/plain; charset="us-ascii"

Hi Diwakar,

Yes  you can boost the score for docs with matches inside specific elements.
You could look up the documentation for this topic. 
https://docs.marklogic.com/guide/search-dev/relevance
This is fairly straight forward.

Regards,

Peter

From: "diwakar.narayanasw...@wipro.com<mailto:diwakar.narayanasw...@wipro.com>" 
<diwakar.narayanasw...@wipro.com<mailto:diwakar.narayanasw...@wipro.com>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: donderdag 11 december 2014 15:50
To: "general@developer.marklogic.com<mailto:general@developer.marklogic.com>" 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: [MarkLogic Dev General] Boosting score using additional query


Hi,

    I am using search:search with lot of additional queries in options. Will i 
be able to boost the score, if the match is found inside a particular element 
of a document using an additional query? Do i need to have document quality set 
for this to work?


Thanks,

Diwakar N


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://developer.marklogic.com/pipermail/general/attachments/20141211/bb7d9e56/attachment-0001.html

------------------------------

Message: 4
Date: Thu, 11 Dec 2014 15:09:38 +0000
From: Erik Hennum <erik.hen...@marklogic.com>
Subject: Re: [MarkLogic Dev General] Boosting score using additional
        query
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Message-ID:
        <dfdf2fd50bf5aa42adaf93ff2e3ca185275...@exchg10-be01.marklogic.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi, Diwakar:

The additional queries are typically filters, but there's a trick to create a 
boosting query:

    cts:or-query((cts:and-query(()), YOUR_BOOSTING_QUERIES_HERE))

The nested and query will match anything, so the or query won't filter out any 
documents.

Documents matching the boosting queries should have a somewhat higher score, 
and you can increase the weight of the boosting queries for a more significant 
boost to the score.


Hoping that helps


Erik Hennum

________________________________
From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of 
diwakar.narayanasw...@wipro.com [diwakar.narayanasw...@wipro.com]
Sent: Thursday, December 11, 2014 6:50 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Boosting score using additional query


Hi,

    I am using search:search with lot of additional queries in options. Will i 
be able to boost the score, if the match is found inside a particular element 
of a document using an additional query? Do i need to have document quality set 
for this to work?


Thanks,

Diwakar N


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://developer.marklogic.com/pipermail/general/attachments/20141211/63708360/attachment-0001.html

------------------------------

Message: 5
Date: Thu, 11 Dec 2014 15:23:40 +0000
From: Ron Hitchens <r...@ronsoft.com>
Subject: Re: [MarkLogic Dev General] automatically replace host in
        cluster
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Message-ID: <b4bdb7d3-6702-4c4d-8b33-463b564d2...@ronsoft.com>
Content-Type: text/plain; charset=us-ascii


Hey John,

   Assuming your cluster is still configured basically the same way as when I 
helped you set it up, you're using local disk replication.  Each master forest 
has at least one replica on another cluster node which means that if a node 
dies the cluster is still live and running (after a short failover delay to 
vote the dead guy out of the cluster).

   The easiest way to deal with a lost cluster node is to build a new one, give 
it the identity of the lost one and then have it join the cluster.  Automatic 
forest replication will take over and the new node will, after some amount of 
time, be re-synchronized and everything will be back to normal.

   The only thing left to do at that point will be to have the replacement node 
take over as the master from the replica(s) that took over when he failed.  
Springer has (or at least had) a nightly scheduled task that looks for forests 
that have failed over and tries to flip them back if they're eligible, so you 
don't even have to worry about that.

  There is actually a README in your source tree that I wrote named 
node-recreate.txt that documents how to do this.  I retained a generified 
version which is pasted in below, could be useful to other people.  As written 
up it requires some manual steps, but I think it could be automated with your 
favorite DevOps tool to configure a new box and perform the needed steps.

   Hope this helps.

=============

   Steps to recreate a lost cluster node

   The MarkLogic clusters at XXXX are configured with
local-disk replication for all of the data forests.  Each forest
has at least one replica on another host in the cluster.  This means
that the cluster can tolerate one lost host and continue serving
requests as normal without data loss.

   If a cluster node drops out of the cluster, the replica(s) of
that node's forests will take over.  When the node re-enters the
cluster, its forest will sync-up with the replicas.

   The following is the procedure to cope with a cluster node that
fails and all data is lost on it.  The cluster can carry on without
the lost node until the node is recreated (but it can't tolerate a
second lost node, so it's important to get that node back online).

   A fresh install of MarkLogic cannot simply be booted up and
added to the cluster.  It is necessary to recreate the MarkLogic
cluster configuration on the new node so that it will be recognized
when it attempts to join the cluster.  Luckily, the complete cluster
configuration is shared by all nodes in the cluster.

   Follow these steps to re-create the lost node.

   o Install the operating system and MarkLogic on the new machine.
     Any references to local filesystems in the original MarkLogic
     setup must be identical, and permissions must be correct.  For
     example, if forests were on /volumes/raid/blah then that path
     must be available and writable by MarkLogic.

   o If you haven't started MarkLogic yet, go ahead and do so
     (sh /etc/init.d/MarkLogic start).  Point your browser at
     localhost:8001 and go through the initial setup, including
     entering the license key.

   o Once that's done, shut down MarkLogic (via the Admin UI or
     by running "sh /etc/init.d/MarkLogic stop").

   o cd to /var/opt/MarkLogic

   o You should see several XML files there.  The only one you care
     about is server.xml.  Copy it to /tmp.

   o It is best to shutdown the cluster before doing the following
     step.  But if this is difficult, it will probably be ok to do
     it while the cluster is running.  Just make sure no configuration
     changes are made until all the following steps are completed.

   o You now need to copy the cluster config from one of the functioning
     nodes in the cluster.  Pick one, it doesn't matter which, and log
     into it.  On that machine, cd to /var/opt/MarkLogic.  You should
     see several XML files there as well, but more of them.  Use scp
     to copy them to the machine you're re-creating:

          scp *.xml new-machine:/var/opt/MarkLogic

   o Back on the new machine, check that all those XML files are
     now in /var/opt/MarkLogic

   o Edit server.xml (the one that was just copied over) and replace
     the <license-key> field with the value in the server.xml that you
     copied to /tmp in an earlier step.  You may also need to copy
     the <licensee> field as well if it's not the same in both files.

   o Next, copy the <host-id> field from hosts.xml, which is one of
     the files that you scp'ed from the other host.  In hosts.xml,
     search for a <host-name> element containing the host name of the
     new machine that you're recreating.  Copy the value of the <host-id>
     element (usually immediately above the host name) into server.xml.

   o The host id in server.xml will now identify the new machine to the
     cluster as the one that was lost.

   o If you stopped the cluster earlier, restart all the nodes of the
     cluster except the new one.  There could be a delay of several
     minutes before the Admin UI of the cluster begins responding as
     normal.  Wait until the cluster is back up.

   o At this point, the Hosts list on the cluster Admin UI should
     still show the failed node as Disconnected.

   o Start MarkLogic on the new node.  And keep an eye on its log
     file (tail -f /var/opt/MarkLogic/Logs/ErrorLog.txt).  You should
     see messages indicating that forests have been mounted from the
     other nodes in the cluster, followed by messages saying that
     forests are being synchronized.  Depending on the amount of data
     in the forests, it may take a while for them to fully synchronize.

   o In the Admin UI, the node you've just created should now show
     as Connected.  And all of it's forest should now be online.  If
     you list all forests, they should all be either "Open" or
     "Sync Replicating".  Once a day, at 1:00am, a script runs that
     will attempt to re-balance the master/replicas.  If the forests
     have finished syncing by then they should flip around to their
     proper master/replica relationships.

   o That's it, you're done.  Exhale.


Ron Hitchens, 2011-12-07

---
Ron Hitchens {r...@overstory.co.uk}  +44 7879 358212

On Dec 11, 2014, at 10:30 AM, "Muth, John, Springer UK" 
<john.m...@springer.com> wrote:

>
> Hello,
>
> I'm considering writing some XQuery to automatically update the configuration 
> of a cluster where one host has died and you want to replace it with a new 
> one.
> We already have scripts in place that automatically configure the new host, 
> and join it to the cluster.
> The bit we're missing is updating the forests, to make it so the forests that 
> were previously on the now-dead host are instead on the replacement host.
> I'm imagining a new script/endpoint that would be something like:
>
> /move-forests?old-host=dead-host.domain.com&new-host=replacement-host.domain.com
>
> It looks like it should be fairly straightforward to do using existing admin: 
> functions, something like:
>
> - for each database,
>    - for each forest
>       - if on dead host
>       - copy to new host and delete from dead host
>
> - delete dead host
>
> Does this sound reasonable?
> Has anybody done this kind of thing?
> Any gotchas, etc?
>
> Thanks,
> John
>
> _______________________________________________
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general



------------------------------

_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 126, Issue 20
****************************************
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to