Oh, in case that helps, I'm using Neo4j 2.1.2 and SDN 3.2.0-SNAPSHOT.

On Tuesday, July 1, 2014 8:46:00 AM UTC+1, Liliana Ziolek wrote:
>
> Hi,
> I'm trying to do - I thought - a rather simple thing - import data through 
> CSV import and then work with it via SDN. It doesn't seem to be working 
> though and not sure if I'm doing something silly or it doesn't work. It 
> seems to me that the data is created fine and SDN can access it via findAll 
> method, but it cannot find it using the indexed field.
>
> My POJO is quite simple, the important bit:
>
> public class City extends GraphNode {
>     @Indexed(indexType = IndexType.FULLTEXT, indexName = "locations")
>     private String name;
> (... other fields)
> }
>
> I have an SDN repository with the following methods:
> public interface CityRepository extends GraphRepository<City> {
>     Page<City> findByNameLike(String name, Pageable page);
>     List<City> findByName(String cityName);
> ...
> }
> On top of that a super-simple service that pretty much just wraps that 
> into @Transactional.
>
> Everything works fine when I use SDN to put the data in and take it out, 
> this passes fine:
>         locationService.addCity("Poznan", "Poland");
>         List<City> citiesByNameLike = 
> locationService.getCitiesByNameLike("Pozn*");
>         assertThat(citiesByNameLike, hasSize(1));
>         assertThat(locationService.getCitiesByName("Poznan"), 
> equalTo(citiesByNameLike));
>
> However, when I import it via CSV import and MERGE, even though I can see 
> that the city is actually there (when I run findAll), it doesn't come back 
> when I try to look it up by name.
> CSV import query:
> //csv fields: Airport,City,Country,IATAcode,ICAOcode
>         String cypherLoadCountries = "LOAD CSV WITH HEADERS FROM \"" + 
> fileLocation + "\" AS csvLine "
>                 + "MERGE (country:Country:_Country { name: csvLine.Country 
> } ) "
>                 + "MERGE (city:City:_City { name: csvLine.City } ) "
>                 + "MERGE (city) - [:IS_IN] -> (country) "
>                 + "MERGE (airport:Airport:_Airport {name: csvLine.Airport, 
> iataCode: csvLine.IATAcode, icaoCode: csvLine.ICAOcode} ) "
>                 + "MERGE (airport) - [:SERVES {__type__: 
> 'AirportCityConnection'}] -> (city)";
>         neo4jTemplate.query(cypherLoadCountries, ImmutableMap.of());
>
> Am I doing something silly here? Is there meant to be a call to switch on 
> indexing or perhaps SDN indexes a different field?
> Any help appreciated.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to