-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from fresearchgroup/search
Search
- Loading branch information
Showing
26 changed files
with
9,860 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import datetime | ||
from haystack import indexes | ||
from .models import Community | ||
from django.utils import timezone | ||
from haystack.fields import CharField | ||
|
||
|
||
class CommunityIndex(indexes.SearchIndex, indexes.Indexable): | ||
text = indexes.EdgeNgramField(document=True, model_attr='name') | ||
category = indexes.CharField(model_attr='category', faceted=True) | ||
created_at = indexes.DateTimeField(model_attr='created_at') | ||
|
||
# for spelling suggestions | ||
suggestions = indexes.FacetCharField() | ||
|
||
def get_model(self): | ||
return Community | ||
|
||
def index_queryset(self, using=None): | ||
# """Used when the entire index for model is updated.""" | ||
return self.get_model().objects.all() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import datetime | ||
from haystack import indexes | ||
from .models import Media | ||
from django.utils import timezone | ||
from haystack.fields import CharField | ||
|
||
|
||
class MediaIndex(indexes.SearchIndex, indexes.Indexable): | ||
text = indexes.EdgeNgramField(document=True, model_attr='title') | ||
#category = indexes.CharField(model_attr='category', faceted=True) | ||
mediafile = indexes.CharField(model_attr='mediafile') | ||
state = indexes.CharField(model_attr='state') | ||
|
||
|
||
# for spelling suggestions | ||
#suggestions = indexes.FacetCharField() | ||
|
||
def get_model(self): | ||
return Media | ||
|
||
def index_queryset(self, using=None): | ||
# """Used when the entire index for model is updated.""" | ||
return self.get_model().objects.all() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: '3' | ||
version: '2' | ||
|
||
services: | ||
db: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.