Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2a17056
wip: BaseTroveView
aaxelb Mar 25, 2025
82aaf4f
wip
aaxelb Mar 26, 2025
f69bb87
wip
aaxelb Mar 28, 2025
d0b142c
wip
aaxelb Mar 28, 2025
21c3c84
(wip) improve tests
aaxelb Mar 31, 2025
ad3e968
wip
aaxelb Mar 31, 2025
69d7313
wip
aaxelb Apr 1, 2025
3669aa4
wip
aaxelb Apr 2, 2025
eb8e26f
ingest_from
aaxelb Apr 3, 2025
3306874
clarify shorthands
aaxelb Apr 3, 2025
322a29c
wip (tests)
aaxelb Apr 3, 2025
5f25bff
wip/fix
aaxelb Apr 3, 2025
605d256
wip (landing page)
aaxelb Apr 7, 2025
7e63c70
fix: test
aaxelb Apr 9, 2025
541588d
ignore unhelpful test pytest warnings
aaxelb Apr 9, 2025
bf63f5a
wip
aaxelb Apr 21, 2025
b5b5c98
easier feature-flag flipping
aaxelb Apr 21, 2025
8082ed1
improved ingest_from_another_shtrove
aaxelb Apr 21, 2025
e8fbaf1
wip
aaxelb Apr 21, 2025
68b0270
wip
aaxelb Apr 21, 2025
1a7cadb
wip
aaxelb Apr 22, 2025
14b7e32
wip
aaxelb Apr 22, 2025
b61af9b
chore: better trovesearch tests, factories
aaxelb Mar 18, 2025
84dbd1d
Merge pull request #856 from aaxelb/feature/landing-page
aaxelb Apr 24, 2025
1b44fb8
delete `trove_indexcard_flats` index-strategy
aaxelb Apr 25, 2025
e48e52e
Merge pull request #861 from aaxelb/chore/shed_flats
aaxelb Apr 25, 2025
e70e1a0
removed text parsing
bodintsov Apr 23, 2025
72225f0
fix flake8
bodintsov Apr 23, 2025
52b1997
fix flake8
bodintsov Apr 23, 2025
c4483f5
fix trovesearch_denorm
bodintsov Apr 23, 2025
2c3319f
flake 8
bodintsov Apr 23, 2025
18e58e3
fix tests, fixed naming, further improvements
bodintsov Apr 24, 2025
9b05a6a
less specific "common" searchtext tests
aaxelb Apr 24, 2025
21cf85a
oops: missed a dangre
aaxelb Apr 24, 2025
03791b3
skip tests for soon-to-be-removed trove_indexcard_flats strategy
aaxelb Apr 24, 2025
a927c97
cleanup, renaming
bodintsov Apr 25, 2025
32c7646
reverted changes
bodintsov Apr 25, 2025
6d57b20
Merge pull request #857 from bodintsov/feature/share-cleanup-remove_t…
aaxelb Apr 29, 2025
d41a15a
add query syntax with `simple_query_string
bodintsov Apr 29, 2025
2d3d565
simplified
bodintsov Apr 29, 2025
78930de
fix flake8
bodintsov Apr 29, 2025
c526983
Merge pull request #862 from bodintsov/feature/shtrove-add-query-synt…
aaxelb Apr 30, 2025
020331e
update cardSearchText/valueSearchText descriptions
aaxelb May 2, 2025
4a284ca
consistent IRI/iri casing at /trove/docs
aaxelb May 2, 2025
c327604
less misleading property-path docs/examples
aaxelb May 2, 2025
f5220ff
add isContainedBy.creator.name to indexed osfmap text fields
aaxelb May 2, 2025
067d39f
cardSearchText docs: note backslash
aaxelb May 5, 2025
ea9e5ba
Merge pull request #864 from aaxelb/docs/searchtext
aaxelb May 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@
import jwe

from share import __version__


def strtobool(s: str) -> bool:
s = s.lower()
if s in ('t', 'true', '1'):
return True
if s in ('f', 'false', '0'):
return False
raise ValueError(f'unboolable string: "{s}"')
from trove.util.queryparams import parse_booly_str


def split(string, delim):
Expand Down Expand Up @@ -463,7 +455,7 @@ def route_urgent_task(name, args, kwargs, options, task=None, **kw):

SUBJECTS_CENTRAL_TAXONOMY = os.environ.get('SUBJECTS_CENTRAL_TAXONOMY', 'bepress')

HIDE_DEPRECATED_VIEWS = strtobool(os.environ.get('HIDE_DEPRECATED_VIEWS', 'False'))
HIDE_DEPRECATED_VIEWS = parse_booly_str(os.environ.get('HIDE_DEPRECATED_VIEWS', 'False'))

# Regulator pipeline, names of setuptools entry points
SHARE_REGULATOR_CONFIG = {
Expand Down
6 changes: 4 additions & 2 deletions project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
from share.admin import admin_site
from share.oaipmh.views import OAIPMHView
from trove.views.vocab import TroveVocabView
from trove.views.shtrove_root import ShtroveRootView


urlpatterns = [
url(r'^admin/', admin_site.urls),
# url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
path('api/v3/', include('trove.urls', namespace='trove')), # same as 'trove/' but more subtle
path('trove/', include('trove.urls', namespace='trovetrove')),
path('api/v3/', include('trove.urls', namespace='apiv3')), # same as 'trove/' but more subtle
path('trove/', include('trove.urls', namespace='trove')),
path('vocab/2023/trove/<path:vocab_term>', view=TroveVocabView.as_view(), name='trove-vocab'),
url(r'^api/v2/', include('api.urls', namespace='api')),
url(r'^api/(?P<path>(?!v\d+).*)', APIVersionRedirectView.as_view()),
Expand All @@ -32,6 +33,7 @@
permanent=False
), name='favicon'),
url(r'^icons/(?P<source_name>[^/]+).ico$', source_icon_view, name='source_icon'),
path('', ShtroveRootView.as_view()),
]

if settings.DEBUG:
Expand Down
1 change: 1 addition & 0 deletions share/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class FeatureFlagAdmin(admin.ModelAdmin):
readonly_fields = ('name',)
search_fields = ('name',)
list_display = ('name', 'is_up', 'is_defined')
list_editable = ('is_up',)


admin_site.register(AccessToken, AccessTokenAdmin)
Expand Down
1 change: 0 additions & 1 deletion share/models/feature_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class FeatureFlag(models.Model):
ELASTIC_EIGHT_DEFAULT = 'elastic_eight_default'
SUGGEST_CREATOR_FACET = 'suggest_creator_facet'
FORBID_UNTRUSTED_FEED = 'forbid_untrusted_feed'
TROVESEARCH_DENORMILY = 'trovesearch_denormily'
PREPRINT_AFFILIATIONS = 'preprint_affiliations'

# name _should_ be one of the constants above, but that is not enforced by `choices`
Expand Down
11 changes: 2 additions & 9 deletions share/search/index_strategy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from trove.trovesearch import search_params
from .sharev2_elastic5 import Sharev2Elastic5IndexStrategy
from .sharev2_elastic8 import Sharev2Elastic8IndexStrategy
from .trove_indexcard_flats import TroveIndexcardFlatsIndexStrategy
from .trovesearch_denorm import TrovesearchDenormIndexStrategy
from ._base import IndexStrategy
from ._indexnames import parse_indexname_parts
Expand Down Expand Up @@ -38,7 +37,6 @@ class _AvailableStrategies(enum.Enum):

if settings.ELASTICSEARCH8_URL:
sharev2_elastic8 = Sharev2Elastic8IndexStrategy('sharev2_elastic8')
trove_indexcard_flats = TroveIndexcardFlatsIndexStrategy('trove_indexcard_flats')
trovesearch_denorm = TrovesearchDenormIndexStrategy('trovesearch_denorm')


Expand Down Expand Up @@ -96,13 +94,8 @@ def get_strategy_for_sharev2_search(requested_name: str | None = None) -> IndexS
def get_strategy_for_trovesearch(params: search_params.CardsearchParams) -> IndexStrategy:
if params.index_strategy_name: # specific strategy requested
_strategy = parse_strategy_name(params.index_strategy_name, for_search=True)
else:
_strategy_name = (
_AvailableStrategies.trovesearch_denorm.name
if FeatureFlag.objects.flag_is_up(FeatureFlag.TROVESEARCH_DENORMILY)
else _AvailableStrategies.trove_indexcard_flats.name
)
_strategy = get_strategy(_strategy_name, for_search=True)
else: # hard-coded default (...for now)
_strategy = get_strategy(_AvailableStrategies.trovesearch_denorm.name, for_search=True)
return _strategy


Expand Down
Loading