Configuring a Custom Similarity


(phill) #1

I would like to port my customized Similarity class that I wrote for
Lucene over to ElasticSearch.

Is this possible at all before 0.90.0 Beta1?
http://www.elasticsearch.org/guide/reference/index-modules/similarity/

Since "Index Modules" still don't have any page that explains where the
example module defining documents go, can someone remind me again where
the examples get used?

I have script with the following command that I use to create my indices
at this time.

curl -XPOST "http://:9200$node/$indexName/?pretty=1" -d '{
settings: {
number_of_shards: 2,
number_of_replicas: 3,
analysis: {
analyzer: {
...
}
}
}
},
mappings: {
"MyDocumentType1": {
...
}
}

I'm assuming (without documentation to confirm) that once I'm running
0.90.0 I'd just add

, "similarity: {
....
}

Is this correct?

Can I also put the YML equivalent of this block in my elasticsearch.yml
file?

The similarity page shows the Json document:

"similarity" : {
"my_similarity" : {
"type" : "DFR",
"basic_model" : "g",
"after_effect" : "l",
"normalization" : "h2",
"normalization.h2.c" : "3.0"
}
}

Can I specify a custom class using this new 0.90.0 similarity syntax?
Maybe

"similarity": {

"my_similarity": {

   "type": "com.myDomain.extensions.MySimilarity",

   "myArg1" : "foo",

   "myArg2" : "42"

 }

}

-Paul

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Tanguy) #2

Hi Paul,

I made something similar last year, and I hope this may help you:

It was on a 0.20.0.Beta1-SNAPSHOT.

-- Tanguy


Twitter: @tlrx

Le mardi 30 avril 2013 22:25:16 UTC+2, P Hill a écrit :

I would like to port my customized Similarity class that I wrote for
Lucene over to ElasticSearch.

Is this possible at all before 0.90.0 Beta1?
http://www.elasticsearch.org/guide/reference/index-modules/similarity/

Since "Index Modules" still don't have any page that explains where the
example module defining documents go, can someone remind me again where
the examples get used?

I have script with the following command that I use to create my indices
at this time.

curl -XPOST "http://:9200$node/$indexName/?pretty=1" -d '{
settings: {
number_of_shards: 2,
number_of_replicas: 3,
analysis: {
analyzer: {
...
}
}
}
},
mappings: {
"MyDocumentType1": {
...
}
}

I'm assuming (without documentation to confirm) that once I'm running
0.90.0 I'd just add

, "similarity: {
....
}

Is this correct?

Can I also put the YML equivalent of this block in my elasticsearch.yml
file?

The similarity page shows the Json document:

"similarity" : {
"my_similarity" : {
"type" : "DFR",
"basic_model" : "g",
"after_effect" : "l",
"normalization" : "h2",
"normalization.h2.c" : "3.0"
}
}

Can I specify a custom class using this new 0.90.0 similarity syntax?
Maybe

"similarity": {

"my_similarity": { 

   "type": "com.myDomain.extensions.MySimilarity", 

   "myArg1" : "foo", 

   "myArg2" : "42" 

 } 

}

-Paul

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(mathursharp) #3

Hi,

Can you please explain how to use a customsimilarity jar (created by overridding the similarity class of lucene) can be used .
i am confused on how to use this with java api and during mapping.

please help me out.


(system) #4