You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by smooth almonds <si...@gmail.com> on 2012/04/25 21:08:06 UTC
Plugin - To Store Sentences as Fields or Documents?
I'm using Nutch to crawl web pages and then trying to get Solr to return
sentences when I query a word.
So far, I've managed to modify BasicIndexingFilter.java to use OpenNLP's
SentenceDetector. However, what I did was just add tokens in between the
detected sentences so I that I can use a SpanQuery at query time. This might
work fine, but I want to try to store the actual sentences. Do I store them
as fields -OR- documents? I'm still going to apply the standard analyzers to
the sentence field/document and store individual word tokens as terms.
I can see two (and a half) options:
1. Index each sentence as documents themselves with fields such as
'sentenceText', 'id', 'url', 'title' and have multiple documents (as many as
there are sentences) for each web page I've crawled. ie, the page
'http://wiki.apache.org/nutch/' will be broken into sentences, each sentence
having it's own document a field that stores the sentence text, another for
the url, etc. If this option is best, which I suspect, which extension point
do I access to get Nutch to create documents out of the sentences and not
the whole web page?
2. Continue to index each web page as the document and keep the default
Nutch fields - 'content', 'id', 'url', etc - but add a field named
'sentences' with MULTIPLE ENTRIES, like an array? I didn't see a fieldType
like this in the list of fieldTypes.
3. Have SentenceDetector detect the sentences and then create new fields for
each sentence, such as 'sentence_01', 'sentence_02', etc. This seems like a
half-baked idea but I'm throwing it out there anyway.
--
View this message in context: http://lucene.472066.n3.nabble.com/Plugin-To-Store-Sentences-as-Fields-or-Documents-tp3939199p3939199.html
Sent from the Nutch - User mailing list archive at Nabble.com.