These are chat archives for inveniosoftware/invenio

9th
Mar 2016
Jacopo Notarstefano
@jacquerie
Mar 09 2016 08:33
I was wondering if there’s consensus on which libraries/fixtures to use to write integration tests against ES, in order to ensure proper isolation and repeatability.
Or at least a few convincing experiments : )
Lars Holm Nielsen
@lnielsen
Mar 09 2016 09:39
i don’t tink there’s any consensus yet, but invenio-records-rest has an example of creating/destroying a test index…...
Jacopo Notarstefano
@jacquerie
Mar 09 2016 09:49
Thanks! I’ll have a look.
Øystein Blixhavn
@blixhavn
Mar 09 2016 12:02

When setting up facets in my site package, I copy from the example app in records-rest, and now have

RECORDS_REST_FACETS = dict(
    testrecords=dict(
        aggs=dict(
            subject=dict(terms=dict(
                field='subject_added_entry_topical_term.topical_term_or_geographic_name_entry_element')),
        ),
        post_filters=dict(
            subject=terms_filter(
                'subject_added_entry_topical_term.topical_term_or_geographic_name_entry_element'),
        )
    )
)

I'm not getting any facets. Is the testrecords key supposed to be something else?

The aggregations key is included in the /api/records response, but it is empty.
Lars Holm Nielsen
@lnielsen
Mar 09 2016 12:11
testrecords should be replaced with your index name
Øystein Blixhavn
@blixhavn
Mar 09 2016 12:23
Where is that defined? In ElasticSearch the index is called "records-record-v1.0.0" (according to Elastic HQ)
Using records works, but I don't know why
Lars Holm Nielsen
@lnielsen
Mar 09 2016 12:28
because records is an index alias
ie.. you will in the future at some point perhaps have records-record-v1.0.0, records-record-v1.0.1, records-record-v1.1.0, if you evolve your JSON schemas……each schema will generate an ES index. The way you search in all indexes is by defining the same alias on all these indexes…… all this is handled by invenio-search in index init
Tibor Simko
@tiborsimko
Mar 09 2016 13:27
@blixhavn You may want to wait a bit with the exploration, we hope to have by the end of this week an Invenio 3 demo site that will show this with MARC21 bibliographic (and authority, and holdings) schemas.
Eamonn Maguire
@eamonnmag
Mar 09 2016 15:05
do any of you have opinions on alembic for sqlalchemy db migrations? Seems very djangoy :) https://realpython.com/blog/python/flask-by-example-part-2-postgres-sqlalchemy-and-alembic/
Lars Holm Nielsen
@lnielsen
Mar 09 2016 15:23
@eamonnmag We use it as part of invenio-upgrader
However, so far it’s pretty hard to use in a composable…..
Wish I had something like Django-South for Flask
Eamonn Maguire
@eamonnmag
Mar 09 2016 15:34
now it's all one. django has migrations built in
and it's much more robust than south
i'll have a look at it anywa
*y
Mihai Bivol
@mihaibivol
Mar 09 2016 15:55
In a default flask dev environment this method will execute HTTP queries to the same server so I won't be able to call it in any view. Probably this thing should check and get the record from the db.
@jalavik I did pattern matching with inspire-next/invenio3 branch
I actually used the inspirehep fork of invenio3
Jacopo Notarstefano
@jacquerie
Mar 09 2016 15:58
(there’s an extra ‘a’ in the link for some reason)
Jan Åge Lavik
@jalavik
Mar 09 2016 15:59
(Right, we can now change to use invenio-records v1.0.0a10 anyways.)
Mihai Bivol
@mihaibivol
Mar 09 2016 15:59
(OT: tried to append in the browser bar probably)
Saw inveniosoftware/invenio-jsonref wasn't updated recently. can it be used in the place I pointed out?
Lars Holm Nielsen
@lnielsen
Mar 09 2016 16:08
@mihaibivol You need to implement local resolvers for the type of links you got. Currently we don’t have generic local resolvers - see Invenio-OpenAIRE for an example of how to implement these resolvers