database_adapter_elasticsearch 0.2.1 copy "database_adapter_elasticsearch: ^0.2.1" to clipboard
database_adapter_elasticsearch: ^0.2.1 copied to clipboard

discontinued
outdated

Adapter between 'package:database' and Elasticsearch, a full-featured text search engine based on Apache Lucene.

example/example.dart

import 'package:database/database.dart';
import 'package:database_adapter_elasticsearch/database_adapter_elasticsearch.dart';

Future main() async {
  // Set up
  final database = ElasticSearch(
    host: 'localhost',
    credentials: ElasticSearchPasswordCredentials(
      user: 'example user',
      password: 'example password',
    ),
  ).database();
  final collection = database.collection('example');

  // Insert a document
  final document = await collection.insert(data: {'greeting': 'Hello world!'});
  print('Inserted ID: ${document.documentId}');

  // Search documents
  final results = await collection.search(
    query: Query.parse(
      'world hello',
      skip: 0,
      take: 10,
    ),
  );
  print('Found ${results.items} results');
}
2
likes
30
pub points
0%
popularity

Publisher

verified publisherdint.dev

Adapter between 'package:database' and Elasticsearch, a full-featured text search engine based on Apache Lucene.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

built_value, collection, database, meta, universal_io

More

Packages that depend on database_adapter_elasticsearch