First of all let’s describe some basic concepts :
An Update Request Processor Chain, associated to an Update handler, is a pipeline of Update processors, that will be executed in sequence.
It takes in input the added Document (to be indexed) and return the document after it has been processed by all the processors in the chain in sequence.
Finally the document is indexed.
An Update Request Processor is the unit of processing of a chain, it takes in input a Document and operates some processing before it is passed to the following processor in the chain if any.
The main reason for the Update processor is to add intermediate processing steps that can enrich, modify and possibly filter documents , before they are indexed.
It is important because the processor has a view of the entire Document, so it can operate on all the fields the Document is composed.
For further details, follow the official documentation
[3].
tonnebrre
May 3, 2016thanks for your article
tonnebrre
May 10, 2016how can i apply the patch
Alessandro Benedetti
May 10, 2016You don't need , this is part of the official Solr already 🙂
Cheers
tonnebrre
May 12, 2016please tell me witch solr version you use ?
Alessandro Benedetti
May 12, 2016It is already in the Solr code (trunk) .
Not sure it is in any release yet !
Cheers
tonnebrre
May 16, 2016thanks a lot
Tomas Ramanauskas
May 27, 2016Hi, Alessandro, can you share some example on how to use this feature?
I never used Solr before, but today I downloaded solr-6.1.0-68 which I think already contains your modifications.
I then created a demo core:
./solr create -c demo
And also modified solr/demo/conf/solrconfig.xml file and added:
title_t^1.5,author_s
cat_s
bayes
I loaded few documents:
curl http://localhost:8984/solr/demo/update -d '
[
{“id” : “book1”,
“title_t”:[“The Way of Kings”],
“author_s”:”Brandon Sanderson”,
“cat_s”:”fantasy”,
“pubyear_i”:2010,
“ISBN_s”:”978-0-7653-2635-5″
}
]'
curl http://localhost:8984/solr/demo/update -d '
[
{“id” : “book2”,
“title_t”:[“The Way of Kings”],
“author_s”:”Brandon Sanderson”,
“cat_s”:”fantasy”,
“pubyear_i”:2010,
“ISBN_s”:”978-0-7653-2635-5″
}
]'
curl http://localhost:8984/solr/demo/update -d '
[
{“id” : “book3”,
“title_t”:[“The Way of Kings”],
“author_s”:”Brandon Sanderson”,
“cat_s”:”fantasy”,
“pubyear_i”:2010,
“ISBN_s”:”978-0-7653-2635-5″
}
]'
But what query shall I use to see the auto classification results?
Tomas Ramanauskas
May 27, 2016From the slide 28 in http://www.slideshare.net/teofili/text-categorization-with-lucene-and-solr presentation I see that the category is automatically assigned if it doesn't exist in the category field, but I don't get anything assigned if I add new documents:
curl http://localhost:8984/solr/demo/update -d '
[
{“id” : “book4”,
“title_t”:[“The Way of Kings”],
“author_s”:”Brandon Sanderson”,
“pubyear_i”:2010,
“ISBN_s”:”978-0-7653-2635-5″
}
]'
curl http://localhost:8984/solr/demo/update -d '
[
{“id” : “book5”,
“title_t”:[“The Way of Kings”],
“author_s”:”Brandon Sanderson”,
“cat_s”:””,
“pubyear_i”:2010,
“ISBN_s”:”978-0-7653-2635-5″
}
]'
manohar c
June 30, 2016Hi Alessandro,
i added classification in solr , but it is showing error like ” Load error: Error loading class 'ClassificationUpdateProcessorFactory”,
here is my solrconfig.xml.
case_title^1.5,case_history
Issue_Group
bayes
classification
is solr comes with classification algorithm? or should i need to add jar file in solr path?
Please help me to do it.
Thanks and Regards.
Alessandro Benedetti
June 30, 2016Hi Manohar,
Which version of Solr are you using ?
Without applying any patch you need Solr 6.1 .
Following the blog documentation should be enough to have it working, in the case you need some help, let me know!
Cheers
manohar c
June 30, 2016Hi Alessandro,
Thanks for quick response.
I am using solr 5.4.1, it is showing error like : “SolrException: Error loading class 'ClassificationUpdateProcessorFactory'”
How can i add ClassificationUpdateProcessorFactory algorithm in solr 5.4.1
I have different types of categories like Battery failure, Fan failure, HDD, MEMORY , Power Supply etc., in a seperate file.
I am pulling documents from sql server, i need to assign those categories to my documents.
let say
{“id” : “5463789”,
“case_history” fan related issue,
“Issue_Group”:”Fan failure”,
}
{“id” : “5463789”,
“case_history” memory related issues ,
“Issue_Group”:”MEMORY”,
}
Here my solrconfig.xml :
case_history
Issue_Group
knn
10
1
5
classification
Thanks in advance.
manohar c
July 4, 2016I am using Solr 5.4.1 , it is showing error like : “SolrException: Error loading class 'ClassificationUpdateProcessorFactory'” .
Can you please tell me , how can i do “document classification” in solr 5.4.1
Rizwaan Adil
August 17, 2016I am facing the same problem. My classification field Issue_Group is not getting populated after the data pull is over.
No error messages are noticed in the logs either.
lehuyen
October 14, 2016Could you please give me an example how to classification in SOLR???