{"id":31665350,"url":"https://github.com/pukkaone/graphql-search","last_synced_at":"2026-04-27T16:32:32.453Z","repository":{"id":316144869,"uuid":"1048181112","full_name":"pukkaone/graphql-search","owner":"pukkaone","description":"GraphQL server for search","archived":false,"fork":false,"pushed_at":"2025-11-16T10:39:13.000Z","size":43,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T12:17:30.978Z","etag":null,"topics":["elasticsearch","graphql","graphql-java","graphql-server","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pukkaone.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-01T04:03:24.000Z","updated_at":"2025-11-16T10:38:19.000Z","dependencies_parsed_at":"2025-09-23T00:24:14.763Z","dependency_job_id":"88ed508e-38ce-41d6-8089-6b4d4d853892","html_url":"https://github.com/pukkaone/graphql-search","commit_stats":null,"previous_names":["pukkaone/graphql-search"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pukkaone/graphql-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pukkaone%2Fgraphql-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pukkaone%2Fgraphql-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pukkaone%2Fgraphql-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pukkaone%2Fgraphql-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pukkaone","download_url":"https://codeload.github.com/pukkaone/graphql-search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pukkaone%2Fgraphql-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32345802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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","graphql","graphql-java","graphql-server","spring-boot"],"created_at":"2025-10-07T21:55:07.626Z","updated_at":"2026-04-27T16:32:32.438Z","avatar_url":"https://github.com/pukkaone.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"= GraphQL Server For Search\n\nAn example server exposes a GraphQL API for search indices by following a schema-first approach.\nStarting from a schema that defines the structure of the documents in search indices, the server\ngenerates:\n\n  * Elasticsearch index mappings, and\n  * GraphQL schema with additional types needed to execute mutations and queries on search indices.\n\n\n== API Version\n\nAn API version implements a different generation of a GraphQL API within a single server.\nA GraphQL schema defines the types and operations implemented by an API version.\nThe server exposes an HTTP endpoint for each API version at the URL paths:\n----\n{server.servlet.context-path}/graphql/{api-version}\n----\n\n== Proto Schema\n\nA proto schema is a schema from which other schema are generated.\nIt is written in the GraphQL schema definition language.\nThe `src/main/resources/search/` directory contains a subdirectory for each API version.\nThe schema files under a API version subdirectory define the proto schema for that API version.\n\n\n=== Directives\n\nDirectives provide information about how to generate the other schema.\n\nThe `@document` directive indicates the annotated object type is the root object of the document to\nbe put in a search index.\n[source,graphql]\n----\ntype Transaction @document {\n----\n\nThe `@id` directive indicates the annotated field uniquely identifies the document in a search\nindex.\nThis is the document ID used to put a document into a search index.\n[source,graphql]\n----\n  transaction_urn: ID! @id\n----\n\nThe `@searchable` directive indicates the annotated field can be queried in a search.\n[source,graphql]\n----\n  city: String! @searchable\n----\n\nBy default, the server translates the `ID` scalar type to the `\"keyword\"` mapping type, and the\n`String` scalar type to the `\"text\"` mapping type.\nThe `type` argument can change the mapping type.\n----\n  product_code: String! @searchable(type: \"keyword\")\n----\n\nBy default, the server translates an object type definition to a mapping with type `\"object\"`.\nThe `type` argument can change the mapping type to `\"nested\"`.\n[source,graphql]\n----\ntype Listing @searchable(type: \"nested\") {\n----\n\n\n== Search Schema\n\nThe search schema is generated from the proto schema.\nThis is the schema exposed by the GraphQL API.\n\n\n=== Create an index and assign an alias to it\n[source,graphql]\n----\nmutation {\n  createIndexWithAlias(\n      type: \"Transaction\"\n      index: \"transaction-1\"\n      alias: \"transaction-write\"\n  )\n}\n----\n\n\n=== Put a document into a search index\n[source,graphql]\n----\nmutation put {\n  putTransaction(\n      index: \"transaction-write\"\n      documents: {\n        transaction_urn: \"transaction:1\"\n        listing: {\n          listing_urn: \"listing:2\"\n          description: \"description\"\n          reserve_price: 2\n          valuation_price: 1\n        }\n        property: {\n          property_urn: \"property:3\"\n          location: {\n            address: {\n              line: \"9641 Sunset Blvd\"\n              city: \"Beverly Hills\"\n              state: \"CA\"\n              postal_code: \"90210\"\n              country: \"US\"\n            }\n            position: {\n              lat: 34.084925\n              lon: -118.413516\n            }\n          }\n          bathrooms: 2\n          bedrooms: 3\n        }\n      }\n  )\n}\n----\n\n\n=== Search for documents\n[source,graphql]\n----\nquery search {\n  transactionSearch(\n      index: \"transaction\"\n      filter: {\n        property: {\n          location: {\n            address: {\n              state: {\n                eq: \"CA\"\n              }\n            }\n          }\n        }\n      }\n      sort: {\n        field: \"property.bedrooms\"\n        direction: ASC\n      }\n  ) {\n    edges {\n      node {\n        transaction_urn\n      }\n    }\n    pageInfo {\n      endCursor\n      hasNextPage\n    }\n  }\n}\n----\n\n\n=== Group documents into buckets\n[source,graphql]\n----\nquery aggregate {\n  transactionSearch(\n      index: \"transaction\"\n      filter: {\n        property: {\n          location: {\n            address: {\n              state: {\n                eq: \"CA\"\n              }\n            }\n          }\n        }\n      }\n      groupBy: {\n        property: {\n          bedrooms: {\n            terms: {\n              first: 10\n            }\n          }\n        }\n      }\n  ) {\n    groupBy {\n      property {\n        bedrooms {\n          key\n          count\n        }\n      }\n    }\n  }\n}\n----\n\n\n==== Filter Operators\n\nThe following filter operators are supported:\n[cols=\"1,3\"]\n|===\n| Operator | Description\n\n| `and:` | All of the conditions must be true\n| `or:` | At least one of the conditions must be true\n| `not:` | All of the conditions must be false\n| `contains:` | A term analyzed from the field value is a term in the list\n| `eq:` | Equal to\n| `in:` | The field value is a value in the list\n| `gt:` | Greater than\n| `gte:` | Greater than or equal to\n| `lt:` | Less than\n| `lte:` | Less than or equal to\n| `exists:` | Whether the field has a value\n| `geoDistance:` | The GeoPoint field value is within the given radius from the given center\n|===\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpukkaone%2Fgraphql-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpukkaone%2Fgraphql-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpukkaone%2Fgraphql-search/lists"}