Hello Nutch users,

I want  to index many web url in elasticsearch and query each web url
separately. E.g. computer book url (http://computerbook.com/java.html),
electronics book url(http://elecbook.com/machin.html) etc..
i have separate type for each book URL, just want to understand how to pass
type in elasticsearch via Nutch, default it is taking *doc, see below from
elastic indexer plugin *

*elasticindexwriter.java*

 public void write(NutchDocument doc) throws IOException {

    String id = (String) doc.getFieldValue("id");

    String type = doc.getDocumentMeta().get("type");

    if (type == null)

     * type = "doc";*
    IndexRequestBuilder request = client.prepareIndex(defaultIndex, type,
id)

by above code all books url will index under "*doc "type. * Is there any
out of the box way to pass *type via Nutch? so if book url is java then
type = "java1234567" like that.*


*Any idea? Thanks in advance.*

Regards
Raj

Reply via email to