Hi Mohsin,

I am using Spring Data Elasticsearch for my project. I have an issue to map 
the document score ('_score' field in elasticsearch) to the POJO. Could you 
provide an example for getting the document score in the sample application.

The following is the source code of my POJO

@Document(indexName = "test",type = "Item" , shards = 17, replicas = 1)
public class ItemSearch {
    @Id
    private String id;
    
 
    private String name;
    
    private String nameWildcard;
    
    private float score;
    
    public ItemSearch(){
        
    }
    
    public ItemSearch(String id){
        this.id = id;
    }
    
    public ItemSearch(String id, String name){
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNameWildcard() {
        return nameWildcard;
    }

    public void setNameWildcard(String nameWildcard) {
        this.nameWildcard = nameWildcard;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }
}

  

On Tuesday, February 12, 2013 4:02:17 AM UTC-8, Mohsin Husen wrote:
>
> Spring Data Elasticsearch sample application is available at Sample 
> Application 
> <https://github.com/BioMedCentralLtd/spring-data-elasticsearch-sample-application>
> I am going to add more test cases soon about nested object , version 
> control etc soon.
>
> Thanks 
> Mohsin
>
> On Friday, 1 February 2013 12:43:44 UTC, mohsin husen wrote:
>>
>> we have just added the support for nested object.
>> please download changes and see below test cases.
>>
>>
>> https://github.com/BioMedCentralLtd/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectTest.java
>>
>> Thanks 
>> Mohsin
>>
>> On Friday, 1 February 2013 10:53:08 UTC, Johann Vanackere wrote:
>>>
>>> Ok, good news. I've made my own build and I'm starting to use it.
>>>
>>> The entities I want to persist in Elasticsearch have nested entities. 
>>> Before using your Spring Data module, I had just to marshall the root 
>>> entity with Jackson. But now, with my root entity annotated with @Document, 
>>> Spring Data complains about nested entities not been mapped.
>>>
>>> How do you achieve nested entities support ?
>>>
>>> Le vendredi 1 février 2013 11:10:59 UTC+1, mohsin husen a écrit :
>>>>
>>>> hello Johann,
>>>>
>>>> Yes we have contacted Spring Data team already for project submission.
>>>>
>>>> http://forum.springsource.org/showthread.php?134421-How-to-add-new-project-to-spring-data&p=436948#post436948
>>>>
>>>> No at present we don't have maven artifact deposited somewhere. For the 
>>>> time being you have to build locally. If we get a node from SpringSource 
>>>> then the artifacts will be available from Spring Source Artifactory.
>>>>
>>>> Thanks 
>>>> Mohsin
>>>>
>>>> On Friday, 1 February 2013 09:54:45 UTC, Johann Vanackere wrote:
>>>>>
>>>>> It looks great !
>>>>>
>>>>> Are maven artifacts available somewhere ?
>>>>> Do you also plan to submit this project for official integration to 
>>>>> Spring  Data projet ?
>>>>>
>>>>> Le lundi 28 janvier 2013 13:24:58 UTC+1, mohsin husen a écrit :
>>>>>>
>>>>>> Hello And greetings to all elasticsearch users and contributors,
>>>>>>
>>>>>> Happy to announced that Spring-Data-Elasticsearch is ready to serve 
>>>>>> with spring data implementation for elasticsearch.
>>>>>> It has all basic features like index, query, etc...
>>>>>>
>>>>>> Test coverage is about 80%  !
>>>>>>
>>>>>> We need more contributor and suggestion to improve it more and make 
>>>>>> it complete one.
>>>>>>
>>>>>> https://github.com/BioMedCentralLtd/spring-data-elasticsearch
>>>>>>
>>>>>> Thanks in Advanced 
>>>>>>
>>>>>> Mohsin.
>>>>>>
>>>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/a470633f-cbd7-4924-afe5-6e6a07a6e3dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to