Create at content management, and serving up that content
SELECT * FROM sessions WHERE title = 'Composer Plugins 101';
SELECT * FROM sessions WHERE title = 'Composer Modules 101';
SELECT * FROM sessions WHERE title = 'Composer Plugin 101';
SELECT * FROM sessions WHERE title = 'Comopser Plugins 101';
0 Results found
SELECT * FROM sessions
WHERE title LIKE '%composer%'
AND title LIKE '%plugins%';
Matches | No Matches |
---|---|
|
|
SELECT * FROM sessions
WHERE title LIKE '%composer%'
OR title LIKE '%plugins%';
Matches | No Matches |
---|---|
|
|
SELECT * FROM sessions WHERE title = 'Composer Modules 101';
SELECT * FROM sessions WHERE title = 'Composer Plugin 101';
SELECT * FROM sessions WHERE title = 'Comopser Plugins 101';
0 Results
SELECT * FROM sessions
WHERE title LIKE '%composer%'
AND title LIKE '%plugins%';
Matched some results, but not as many as we had hoped
SELECT * FROM sessions
WHERE title LIKE '%composer%'
OR title LIKE '%plugins%';
Matched a lot of results, but computationally expensive
Or any relational database
SELECT * FROM sessions
WHERE title LIKE '%composer%'
AND title LIKE '%plugins%';
Scalability of this will become an issue as more rows are added to the database
{
"id": "home 1",
"location": "Charleston, SC",
"bedrooms": 3,
"type": "sale"
}
{
"id": "home 1",
"location": "Charleston, SC",
"mls": 1234566,
"bedrooms": 3,
"type": "sale"
}
{
"id": "home 2",
"location": "Summerville, SC",
"bedrooms": 3,
"type": "rent",
"rent": 1000
}
fq - limits of matching docs
q - limits of matching docs AND calculates relevancy score based on the query parser
$client = new Solarium\Client($adapter, $eventDispatcher, $config);
// get a select query instance
$query = $client->createSelect();
// apply settings using the API
$query->setQuery('*:*');
$query->setStart(2)->setRows(20);
$query->setFields(array('id','title','set', 'price'));
$query->addSort('price', $query::SORT_ASC);
// create a filterquery using the API
$fq = $query->createFilterQuery('maxprice')->setQuery('price:[1 TO 300]');
// create a facet field instance and set options using the API
$facetSet = $query->getFacetSet();
$facet = $facetSet->createFacetField('stock')->setField('inStock');
// this executes the query and returns the result
$resultset = $client->select($query);
// display the total number of documents found by Solr
echo 'NumFound: '.$resultset->getNumFound();
// display facet counts
echo 'Facet counts for field "inStock":';
$facet = $resultset->getFacetSet()->getFacet('stock');
foreach ($resultset as $doc) {
| id | title | set | price |
| $doc->id; | $doc->title | $doc->set | $doc->price |
}
Stop Word Filters
Stem Filters
Word Delimiter Graph Filter
There's a lot more available in the documentation
Solr Filter Descriptions- Solr is awesome
- Solr Documentation
- Solarium Docs
- Follow me on twitter: @aczietlow