In trunk you can use the Inlink and Inlinks classes. The first for each inline 
and the latter to add the Inlink objects to.  

Inlinks inlinks = new Inlinks()
inlinks.add(new Inlink("http://nutch.apache.org/";, "Apache Nutch"));

The inlink URL is the key in the key/value pair so you won't see that one.
 
-----Original message-----
> From:Lewis John Mcgibbney <lewis.mcgibb...@gmail.com>
> Sent: Mon 12-Nov-2012 16:29
> To: user@nutch.apache.org
> Subject: Simulating 2.x's page.putToInlinks() in trunk
> 
> Hi,
> 
> I'm attempting to test the AnchorIndexingFilter by adding numerous
> inlinks and their anchor text then check whether the deduplication is
> working sufficiently.
> 
> Can someone show me how I simulate the following using the trunk API
> 
> // This is 2.x API
> WebPage page = new WebPage();
> page.putToInlinks(new Utf8("$inlink1"), new Utf8("$anchor_text1"));
> page.putToInlinks(new Utf8("$inlink2"), new Utf8("$anchor_text1"));
> page.putToInlinks(new Utf8("$inlink3"), new Utf8("$anchor_text2"));
> 
> If anchor deduplication is set to boolean true value then we could
> only allow two anchor entries for the page inlinks. I wish therefore
> to simulate this in trunk API using Inlinks, Inlink or
> NutchDocument.add function however I am stuck...
> 
> Thank you very much in advance for any help.
> 
> Best
> 
> Lewis
> 
> -- 
> Lewis
> 

Reply via email to