J'utilise neo4j comme mon backend pour un projet Ruby on Rails et j'essaie d'implémenter certaines fonctionnalités de recherche. Bellow est mon modèle:Problème Exécution d'une recherche FullText sur l'entité
class Entity < Neo4j::Rails::Model
property :name
has_n(:friends).to(Entity)
index :name, :type => :fulltext
end
J'ai créé des documents avec les éléments suivants:
Neo4j::Transaction.run do
Entity.destroy_all
tony = Entity.new :name => "Tony Soprano"
paulie = Entity.new :name => "Paulie Gualtieri"
robert = Entity.new :name => "Robert Baccalier"
silvio = Entity.new :name => "Silvio Dante"
tony.friends << paulie << robert << silvio
tony.save
end
Enfin ma méthode de recherche ressemble à ceci:
def search
terms = params[:q]
render :json => Entity.all(:name => terms, :type => :fulltext)
end
Quand je lance la méthode de recherche ci-dessus, Je reçois l'erreur suivante: no index on field type
J'ai lu le Fulltext Search section des guides Neo4j-Rails et je ne vois pas ce qui me manque pour faire ce travail. Ma compréhension est la suivante: la propriété name doit être indexée en raison de la façon dont j'ai configuré le modèle.
Afficher ensemble sort les éléments suivants: neo4j (2.0.1), neo4j-communauté (1.7.1), neo4j-core (2.0.1), neo4j-wrapper (2.0.1) – senfo
Ahhhh, tirer .... J'ai eu ma chaîne de recherche mal. Merci beaucoup! – senfo