{"id":13529572,"url":"https://github.com/graphaware/graph-aided-search","last_synced_at":"2026-01-14T02:50:10.852Z","repository":{"id":51414641,"uuid":"55497956","full_name":"graphaware/graph-aided-search","owner":"graphaware","description":"Elasticsearch plugin offering Neo4j integration for Personalized Search","archived":true,"fork":false,"pushed_at":"2021-05-05T19:53:20.000Z","size":874,"stargazers_count":155,"open_issues_count":0,"forks_count":40,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-01-21T01:33:10.691Z","etag":null,"topics":["elasticsearch","elasticsearch-plugin","java","neo4j"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-05T10:12:43.000Z","updated_at":"2024-07-30T10:31:45.000Z","dependencies_parsed_at":"2022-09-15T01:21:48.716Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/graph-aided-search","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/graphaware/graph-aided-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fgraph-aided-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fgraph-aided-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fgraph-aided-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fgraph-aided-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/graph-aided-search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fgraph-aided-search/sbom","scorecard":{"id":443730,"data":{"date":"2025-08-11","repo":{"name":"github.com/graphaware/graph-aided-search","commit":"b66a5bad4918c4ae771d993732606e482badd333"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.4,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 3/27 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"42 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-xmc8-26q4-qjhx","Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-5mcr-gq6c-3hq2","Warn: Project is vulnerable to: GHSA-9vjp-v76f-g363","Warn: Project is vulnerable to: GHSA-cqqj-4p63-rrmm","Warn: Project is vulnerable to: GHSA-f256-j965-7f32","Warn: Project is vulnerable to: GHSA-grg4-wf29-r9vv","Warn: Project is vulnerable to: GHSA-p2v9-g2qv-p635","Warn: Project is vulnerable to: GHSA-wm47-8v5p-wjpj","Warn: Project is vulnerable to: GHSA-wx5j-54mm-rqqq","Warn: Project is vulnerable to: GHSA-c27h-mcmw-48hv","Warn: Project is vulnerable to: GHSA-r6j9-8759-g62w","Warn: Project is vulnerable to: GHSA-56h3-78gp-v83r","Warn: Project is vulnerable to: GHSA-7rf3-mqpx-h7xg","Warn: Project is vulnerable to: GHSA-grr4-wv38-f68w","Warn: Project is vulnerable to: GHSA-q6g2-g7f3-rr83","Warn: Project is vulnerable to: GHSA-x27m-9w8j-5vcw","Warn: Project is vulnerable to: GHSA-2cqf-6xv9-f22w","Warn: Project is vulnerable to: GHSA-2hjr-vmf3-xwvp","Warn: Project is vulnerable to: GHSA-3393-hvrj-w7v3","Warn: Project is vulnerable to: GHSA-5v8f-xx9m-wj44","Warn: Project is vulnerable to: GHSA-62ww-4p3p-7fhj","Warn: Project is vulnerable to: GHSA-c77j-p484-h84m","Warn: Project is vulnerable to: GHSA-cqgv-256r-m9r8","Warn: Project is vulnerable to: GHSA-fj32-6v7m-57pg","Warn: Project is vulnerable to: GHSA-g9fw-9x87-rmrj","Warn: Project is vulnerable to: GHSA-hr65-qq6p-87r4","Warn: Project is vulnerable to: GHSA-jgx4-7v3v-vwfm","Warn: Project is vulnerable to: GHSA-jqm6-m3j3-8gg9","Warn: Project is vulnerable to: GHSA-mjpc-qx7h-r8c9","Warn: Project is vulnerable to: GHSA-3mc7-4q67-w48m","Warn: Project is vulnerable to: GHSA-98wm-3w3q-mw94","Warn: Project is vulnerable to: GHSA-9w3m-gqgf-c4p9","Warn: Project is vulnerable to: GHSA-c4r9-r8fh-9vj2","Warn: Project is vulnerable to: GHSA-hhhw-99gj-p3c3","Warn: Project is vulnerable to: GHSA-mjmj-j48q-9wg2","Warn: Project is vulnerable to: GHSA-rvwf-54qp-4r6v","Warn: Project is vulnerable to: GHSA-w37g-rhq8-7m4j"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T06:11:33.858Z","repository_id":51414641,"created_at":"2025-08-19T06:11:33.858Z","updated_at":"2025-08-19T06:11:33.858Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","elasticsearch-plugin","java","neo4j"],"created_at":"2024-08-01T07:00:37.542Z","updated_at":"2026-01-14T02:50:10.832Z","avatar_url":"https://github.com/graphaware.png","language":"Java","funding_links":[],"categories":["Full-text search","REST API"],"sub_categories":["REST API","Other"],"readme":"# GraphAware Graph-Aided Search - RETIRED\n\n## GraphAware Graph-Aided Search Has Been Retired\nAs of May 2021, this [repository has been retired](https://graphaware.com/framework/2021/05/06/from-graphaware-framework-to-graphaware-hume.html).\n\n## ElasticSearch Plugin providing integration with Neo4j\n\nGraphAware Graph-Aided Search is an enterprise-grade bi-directional integration between Neo4j and Elasticsearch. It consists\nof two independent modules plus test suites. Both modules can be used independently or together to achieve full integration.\n\nThe [first module](https://github.com/graphaware/neo4j-to-elasticsearch) is a plugin for Neo4j (more precisely, a [GraphAware Transaction-Driven Runtime Module](https://github.com/graphaware/neo4j-framework/tree/master/runtime#graphaware-runtime)),\nwhich can be configured to transparently and asynchronously replicate data from Neo4j to ElasticSearch.\n\nThe second module (this module) is a plugin for Elasticsearch that can query the Neo4j graph database during a search query\nto enrich the result (boost the score) by results that are more efficiently calculated in a graph database, e.g. recommendations.\n\nBoth modules are now open-source production-ready for everyone. They are also officially supported by GraphAware for \u003ca href=\"http://graphaware.com/enterprise/\" target=\"_blank\"\u003eGraphAware Enterprise\u003c/a\u003e subscribers.\n\n## Feature Overview: Graph-Aided Search\n\nThis module is a plugin for Elasticsearch that enables users to improve search results by boosting or filtering them using data stored in the Neo4j graph database.\nAfter performing a search in Elasticsearch, just before returning the results to the user, this plugin requests additional information from Neo4j via its REST API in order to boost or filter the results.\n\nTwo main features are exposed by the plugin: \n\n* **_Result Boosting_**: This feature allows changing the scores of the results. The score can be changed in different ways: mixing graph score with Elasticsearch score or replacing it entirely are just two examples.\nIt is possible to customize this behaviour with different formulas, rewriting some methods of the Graph-Aided Search Booster.\nUsage examples include boosting (i) based on interest prediction (recommendations), (ii) based on friends' interests/likes, (iii) all use cases that are a good fit for Neo4j\n \n* **_Result Filtering_**: This feature allows filtering, thus removing documents from the results list. By providing a Cypher query, it is possible to return to the user only documents with IDs matching the results of the Cypher query.\n\nDetailed workflow:\n\n1. Intercept and parse any \"Search query\" and try to find the `GraphAidedSearch` extension parameter;\n2. Process the query extension identifying the type of the extension (boosting or a filter), and instantiate the related class;\n3. Perform the operation required to boost or filter by calling the Neo4j REST API (or a Neo4j extension like [Graphaware Recommendation Engine](https://github.com/graphaware/neo4j-reco), passing all necessary information,\ne.g. Cypher query, target user, etc...;\n4. Return the filtered/boosted result set back to the user;\n\n![overview](https://s3-eu-west-1.amazonaws.com/graphaware/assets/graphAidedSearchIntro2.png)\n\n---\n\n## Usage: Installation\n\n### Install Graph-Aided Search Binary\n\n#### Elasticsearch 2.2.2:\n\n```bash\n$ $ES_HOME/bin/plugin install com.graphaware.es/graph-aided-search/2.2.2.0\n```\n\n#### Elasticsearch 2.3.1:\n\n```bash\n$ $ES_HOME/bin/plugin install com.graphaware.es/graph-aided-search/2.3.2.0\n```\n\n### Build from source\n\n```bash\n$ git clone git@github.com:graphaware/graph-aided-search.git\n$ mvn clean package\n$ $ES_HOME/bin/plugin install file:///path/to/project/graph-aided-search/target/releases/graph-aided-search-2.X.X.0.zip\n```\n\nStart elasticsearch\n\n### Configuration\n\nThen configure indexes with the url of Neo4j. This can be done in two ways. First:\n\n```bash\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.hostname=http://localhost:7474\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.enable=true\n```\n\n\u003e **indexname** as your index name.\ne.g.\ncurl -XPUT http://localhost:9200/neo4j-index-node/_settings?index.gas.enable=true\n\nIf the Neo4j Rest Api is protected by Basic Authentication confire username and password for neo4j in the following way:\n\n```bash\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.user=neo4j\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.password=password\n```\n\nIf the neo4j server supports bolt it can be enable and managed using the following configuration\n\n```bash\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.boltHostname=bolt://localhost:7687\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.bolt.secure=false (default is true)\n```\nSince bolt is still not a stabel release, the default protocol is http, to enable it add the following line in the booster or filter configuration:\n\n```json\n\"protocol\": \"bolt\"\n```\n\nSecond, you can use also template to configure settings in the index:\n\n```json\n    curl -XPOST http://localhost:9200/_template/template_gas -d \\\n    '{\n      \"template\": \"*\",\n      \"settings\": {\n        \"index.gas.neo4j.hostname\": \"http://localhost:7474\",\n        \"index.gas.neo4j.boltHostname\": \"bolt://localhost:7687\",\n        \"index.gas.enable\": true,\n        \"index.gas.neo4j.user\": \"neo4j\",\n        \"index.gas.neo4j.password\": \"password\"\n      }\n    }'\n```\n\n### Disable Plugin\n\n```bash\n$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.enable=false\n```\n\nQueries will continue to work even with Graph-Aided-Search-specific elements, e.g. \"gas-boost\" and \"gas-filter\".\n\n## Usage: Search Phase\n\nThe integration with a pre-existing search query is seamless, since the plugin only requires the addition of new elements into the query.\n\n### Booster example\n\nBoosters allow to change the score by an external score source. This could be a `recommender`, a Cypher query, or any custom booster provider.\nA simple Elasticsearch query could have the following structure:\n\n```bash\n  curl -X POST http://localhost:9200/neo4j-index/Movie/_search -d '{\n    \"query\" : {\n        \"match_all\" : {}\n    }';\n```\n\nIn this case all the Elasticsearch result hits will have a relevancy score value of `1`. If you would like to boost these results according to user interest computed by Graphaware Recommendation Plugin on top of\nNeo4j, you would change the query in the following way.\n\n```bash\n  curl -X POST http://localhost:9200/neo4j-index/Movie/_search -d '{\n    \"query\" : {\n        \"match_all\" : {}\n    },\n    \"gas-booster\" :{\n          \"name\": \"SearchResultNeo4jBooster\",\n          \"target\": \"2\",\n          \"maxResultSize\": 10,\n          \"keyProperty\": \"objectId\",\n          \"neo4j.endpoint\": \"/graphaware/recommendation/movie/filter/\"\n       }\n  }';\n```\nThe **_gas-booster_** clause identifies the type of operation, in this case it defines a boost operation.\nThe **_name_** parameter is mandatory and allows to specify the Booster class. The remaining parameters depend on the type of the booster.\nIn the following paragraph the available boosters are described.\n\n#### SearchResultNeo4jBooster\n\nThis booster uses Neo4j through custom REST APIs available as plugins for the database. In this case, the _name_ value must be set to `SearchResultNeo4jBooster`.\n\nThe following parameters are available for this booster:\n\n* **target**: (Mandatory) This parameter contains the identifier of the target for which the boosting values are computed.\nSince the boosting is customized according to a target, this parameter is mandatory and allows getting different results for different target (typically a user).\n\n* **maxResultSize**: (Default is set to the max result windows size of elasticsearch, defined by the parameter index.max_result_window)\nWhen search query is changed before submitting it to elasticsearch engine, the value of \"size\" for the results returned is changed according to this parameter.\nThis is necessary since once the boosting function is applied, the order may change. Some of the results that wouldn't \"make it\" may be boosted and fall into the \"size\" window.\n\n* **keyProperty**: (Default value is `uuid`) the id of each document in the search results must match some property value of the nodes in the graph.\nIn order to avoid ambiguities in the results, this property must identify a single node. Using \u003ca href=\"https://github.com/graphaware/neo4j-uuid\" target=\"_blank\"\u003eGraphAware UUID\u003c/a\u003e with Neo4j is recommended for this purpose.\n\n* **operator**: (Default is multiply [*]) It specifies how to combine the Elasticsearch score with the score provided by Neo4j.\nAvailable operators are: * (multiply), + (sum), - (substract), / (divide), replace (replace score).\n\n* **neo4j.endpoint**: (Default /graphaware/recommendation/filter) It defines the endpoint to which the request is submitted in order to get a boosting.\nIt is added to the Neo4j host value defined for the index.\n\nInformation about the list of IDs that should be boosted as well as the target is passed to the API running atop Neo4j. The REST API should expose a POST endpoint that accepts the following parameters:\n\n* **target** (url parameter): This is the value of target defined above and it is used to identify the user or item for which the score will be computed from the recommender;\n\n* **limit**: This value can be used to limit the number of results provided be the REST API;\n\n* **from**: In order to support pagination this value allows to skip a number of results;\n\n* **keyProperty**: Specify the property on the nodes used to identify the nodes. Such property will be used to filter the results, according to the lists of \"ids\";\n\n* **ids**: Comma-separated list of node identifiers that must be evaluated and then returned;\n\nExample Call:\n\n```\nhttp://localhost:7474/graphaware/recommendation/movie/filter/2\n\nParameters:\nlimit=2147483647\u0026from=0\u0026keyProperty=objectId\u0026ids=99,166,486,478,270,172,73,84,351,120\n```\nThis component supposes that the results are a json array with the following structure.\n\n```json\n[\n  {\n    \"nodeId\": 1212,\n    \"objectId\": \"270\",\n    \"score\": 3\n  },\n  {\n    \"nodeId\": 1041,\n    \"objectId\": \"99\",\n    \"score\": 1\n  },\n  {\n    \"nodeId\": 1420,\n    \"objectId\": \"478\",\n    \"score\": 1\n  },\n  {\n    \"nodeId\": 1428,\n    \"objectId\": \"486\",\n    \"score\": 1\n  }\n]\n```\n\n#### SearchResultCypherBooster\n\nThis booster uses Neo4j through custom REST APIs available as plugins for the database. In this case the _name_ value must be set to `SearchResultCypherBooster`.\n\nThe following parameters are available for this booster:\n\n* **query**: (Mandatory) This parameter contains the query to submit to the Neo4j instance.\n\n* **scoreName**: (Default value is \"score\") The name of the returned value that is used as scoring function.\n\n* **identifier**: (Default value is \"id\") The name of the returned value that is used for matching IDs.\n\n* **maxResultSize**: (Default is set to the max result windows size of elasticsearch, defined by the parameter index.max_result_window)\nWhen search query is changed before submitting it to elasticsearch engine, the value of \"size\" for the results returned is changed according to this parameter.\nThis is necessary since once the boosting function is applied, the order may change. Some of the results that wouldn't \"make it\" may be boosted and fall into the \"size\" window.\n\n* **operator**: (Default is multiply [*]) It specifies how to combine the Elasticsearch score with the score provided by Neo4j.\nAvailable operators are: * (multiply), + (sum), - (substract), / (divide), replace (replace score).\n\nThe Elasticsearch result hits ids are passed as Cypher query parameter as a `List` of strings named `items`.\n\nExample Use:\n\n```\n  curl -X POST http://localhost:9200/neo4j-index/Movie/_search -d '{\n    \"query\" : {\n        \"match_all\" : {}\n    },\n    \"gas-booster\" :{\n          \"name\": \"SearchResultCypherBooster\",\n          \"query\": \"MATCH (input:User) WHERE id(input) = 2\n                    MATCH p=(input)-[r:RATED]-\u003e(movie)\u003c-[r2:RATED]-(other)\n                    WITH other, collect(p) as paths\n                    WITH other, reduce(x=0, p in paths | x + reduce(i=0, r in rels(p) | i+r.rating)) as score\n                    WITH other, score\n                    ORDER BY score DESC\n                    MATCH (other)-[:RATED]-\u003e(reco)\n                    RETURN reco.objectId as id, score\n                    LIMIT 500\",\n          \"maxResultSize\": 1000,\n          \"scoreName\": \"score\",\n          \"identifier\": \"id\"\n       }\n  }';\n```\n\n### Filter Example\n\nFilters allow to filter the results using information stored in the graph. For example, you can filter movies based on what the user's friends have seen.\nIf you would like to filter results according to a user's friends evaluation, it is possible to change the Elasticsearch query as follows:\n\n```\n  curl -X POST http://localhost:9200/neo4j-index/Movie/_search -d '{\n    \"query\" : {\n        \"match_all\" : {}\n    },\n    \"gas-filter\" :{\n          \"name\": \"SearchResultCypherFilter\",\n          \"query\": \"MATCH (input:User) WHERE id(input) = 2\n                   MATCH (input)-[f:FRIEND_OF]-\u003e(friend)-[r:RATED]-\u003e(movie)\n                   WHERE r.rate \u003e 3\n                   RETURN movie.uuid as id\",\n          \"exclude\": false\n       }\n  }';\n```\n\nThe **_gas-filter_** clause identifies the type of the operation; in this case a filter operation.\nThe **_name_** parameter is mandatory and allows to specify the Filter class. The remaining parameters depends on the type of filter.\nIn the following paragraph the available filters are described.\n\n#### SearchResultCypherFilter\n\nThis filter allows to filter results using a Cypher query on Neo4j. In this case the _name_ value must be set to `SearchResultCypherFilter`.\n\nThe following parameters are available for this filter:\n\n* **query**: (Mandatory) This parameter contains the query to submit to the Neo4j instance.\n\n* **maxResultSize**: (Default is set to the max result windows size of elasticsearch, defined by the parameter index.max_result_window)\nWhen search query is changed before submitting it to elasticsearch engine, the value of \"size\" for the results returned is changed according to this parameter.\nThis is necessary since once the filtering function is applied, some of the results that wouldn't \"make it\" may fall into the \"size\" window.\n\n* **exclude**: (Default true) This parameter allows to define the behaviour of the Filter.\nIf set to true (default), it will filter out the Neo4j results from the results provided by Elasticsearch. If set to false, it will\nkeep the intersection of Neo4j and Elasticsearch results, i.e. exclude everything that has not been returned by Neo4j.\n\n## Customize the plugin\n\nThe plugin allows to implement custom boosters and filters. In order to implement a booster, `SearchResultBooster` must be implemented\nand it needs to have the following annotation:\n\n```\n@SearchBooster(name = \"MyCustomBooster\")\n```\nMoreover, it should be in the package `com.graphaware.es.gas`.\n\nIn order to implement a filter, `SearchResultFilter` must be implemented and it needs to have the following annotation:\n\n```\n@SearchFilter(name = \"MyCustomFilter\")\n```\n\nAlso in this case, it should be in the package `com.graphaware.es.gas`.\n\n## Version Matrix\n\nThe following version are currently supported\n\n| Version (this project)   | Elasticsearch |\n|:---------:|:-------------:|\n| master    | 2.4.4         |\n| 2.3.2.2   | 2.3.2         |\n| 2.3.1.0   | 2.3.1         |\n| 2.2.2.0   | 2.2.2         |\n\n### Issues/Questions\n\nPlease file an [issue](https://github.com/graphaware/graph-aided-search/issues \"issue\").\n\nLicense\n-------\n\nCopyright (c) 2016 GraphAware\n\nGraphAware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License\nas published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied\nwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program.\nIf not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fgraph-aided-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fgraph-aided-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fgraph-aided-search/lists"}