Skip to content

Commit

Permalink
readme and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nticaric committed May 11, 2016
1 parent b8582c3 commit 3194974
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The easiest way to install TNTSearch is via [composer](http://getcomposer.org/).
```json
{
"require": {
"teamtnt/tntsearch": "0.4.*"
"teamtnt/tntsearch": "0.5.*"
}
}
```
Expand Down Expand Up @@ -105,6 +105,31 @@ the results in required order

```

## Updating the index

Once you created an index you don't need to reindex it each time you make some changes
to your document collection. TNTSearch supports dynamic index updates.

```php
use TeamTNT\TNTSearch\TNTSearch;

$tnt = new TNTSearch;

$tnt->loadConfig($config);
$tnt->selectIndex("name.index");

$index = $tnt->getIndex();

//to insert a new document to the index
$index->insert(['id' => '11', 'title' => 'new title', 'article' => 'new article']);

//to update an existing document
$index->update(11, ['id' => '11', 'title' => 'updated title', 'article' => 'updated article']);

//to delete the document from index
$index->delete(12);
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
Expand Down

1 comment on commit 3194974

@dragonfire1119
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait to try this new feature! Great job!

Please sign in to comment.