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
#!/bin/sh | |
# Remove old data | |
curl -XDELETE "http://localhost:9200/fml?pretty=true" | |
# Add some data - default mappings are fine | |
curl -XPOST "http://localhost:9200/fml/widget/?pretty=true" -d ' | |
{ | |
"name": "uno", | |
"tags": [ |
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
#!/bin/sh | |
echo "Remove old index..." | |
curl -XDELETE "http://localhost:9200/fml?pretty=true" | |
echo "Make index and add some data - default mappings are fine" | |
curl -XPOST "http://localhost:9200/fml/widget/?pretty=true" -d ' | |
{ | |
"name": "uno", | |
"postDate" : "2009-11-15" |
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
#!/bin/sh | |
# Overall purpose of index_name usage here is to work around bug https://github.com/elasticsearch/elasticsearch/issues/5851 | |
echo "Remove old index..." | |
curl -XDELETE "http://localhost:9200/fml?pretty=true" | |
echo "Make index and add some data..." | |
curl -XPOST "http://localhost:9200/fml/" |
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
import argparse | |
from first import first | |
from deus_lib.scripts import initialize_script | |
from bias.models import ( | |
LexSession, | |
) | |
from lexdb.model import ( | |
PatentCitation, | |
DocketEntry, | |
MultipleDocument, |
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
from bias import bias_after_setup; bias_after_setup(celery.conf); from lexdb.model.motion import dump_motions_for_case; from bias.models import LexSession; from lexdb.model import * ; import logging; logging.basicConfig(level=logging.DEBUG); from bias.tasks.annotate import *; | |
from lexdb.model.patent import recalculate | |
case_id=7550; pnum='6245648' | |
c = LexSession.query(Case).filter(Case.id == case_id).one() | |
pc = LexSession.query(PatentCitation).filter(PatentCitation.case_id == case_id).filter(PatentCitation.patent_number == pnum).all() | |
p = LexSession.query(Patent).filter(Patent.number == pnum).one() | |
recalculate(c, p, pc) |
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
{ | |
"_shards" : { | |
"total" : 30, | |
"successful" : 30, | |
"failed" : 0 | |
}, | |
"_all" : { | |
"primaries" : { | |
"docs" : { | |
"count" : 18808988, |
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
{ | |
"_shards" : { | |
"total" : 30, | |
"successful" : 30, | |
"failed" : 0 | |
}, | |
"_all" : { | |
"primaries" : { | |
"docs" : { | |
"count" : 20982332, |
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
import sys | |
def main(): | |
# assumes only command line arg is logging from | |
# logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) | |
# for 1 query. | |
# assumes last line is dict of params | |
with open(sys.argv[1], 'r') as my_file: | |
lines = my_file.readlines() |