mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-12-04 03:00:24 +00:00
rfctr [P6M-397]: opensearch source connector v2 (#3302)
Updates opensearch source connector to v2. Leverages elasticsearch v2 heavily. Expected tests renamed because thats how Elasticsearch names them.
This commit is contained in:
parent
db8617872b
commit
a18b21c06e
@ -1,4 +1,4 @@
|
||||
## 0.14.10-dev1
|
||||
## 0.14.10-dev2
|
||||
|
||||
### Enhancements
|
||||
|
||||
|
||||
@ -1,107 +1,107 @@
|
||||
[
|
||||
{
|
||||
"element_id": "0deeb41dfdab49b5df593a4ba334e9f5",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "0",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "9cd9874c944c6a15749fe5767312a79a",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "4060d679d2cc6f17cd3435d7d08ba796",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "0",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "45ff90a252493aeb54e26b45050887eb",
|
||||
"text": "Alice follows a large white rabbit down a \"Rabbit-hole\". She finds a tiny door. When she finds a bottle labeled \"Drink me\", she does, and shrinks, but not enough to pass through the door. She then eats something labeled \"Eat me\" and grows larger. She finds a fan when enables her to shrink enough to get into the \"Garden\" and try to get a \"Dog\" to play with her. She enters the \"White Rabbit's tiny House,\" but suddenly resumes her normal size. In order to get out, she has to use the \"magic fan.\"",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "d228106ca65a5fe5a798466e33b99ea7",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "0",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "9c0d9fed3eb8eea0634a5a4ee471f45a",
|
||||
"text": "She enters a kitchen, in which there is a cook and a woman holding a baby. She persuades the woman to give her the child and takes the infant outside after the cook starts throwing things around. The baby then turns into a pig and squirms out of her grip. \"The Duchess's Cheshire Cat\" appears and disappears a couple of times to Alice and directs her to the Mad Hatter's \"Mad Tea-Party.\" After a while, she leaves.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "0fa935dd293a7f4300873878edeb7406",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "0",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "f952e51ad6b8be3007a729980b04bcaa",
|
||||
"text": "The Queen invites Alice to join the \"ROYAL PROCESSION\": a parade of marching playing cards and others headed by the White Rabbit. When Alice \"unintentionally offends the Queen\", the latter summons the \"Executioner\". Alice \"boxes the ears\", then flees when all the playing cards come for her. Then she wakes up and realizes it was all a dream.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "b49a65d2e7bf81c313be0cc371d6c4d0",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "0",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "9e8f5aedbd95405adce2563747bce093",
|
||||
"text": "Cecil Hepworth",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "Cecil Hepworth",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "7202f8ae8a26285a8a5eb189e776a211",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "1",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "e9e2949adb0a1004997619eb751aaa52",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "4c953bfd637a69fb11dadaa70a9f5d93",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "1",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "b6085f36fb0606ab786f0a7afe1484d5",
|
||||
"text": "Boone's daughter befriends an Indian maiden as Boone and his companion start out on a hunting expedition. While he is away, Boone's cabin is attacked by the Indians, who set it on fire and abduct Boone's daughter. Boone returns, swears vengeance, then heads out on the trail to the Indian camp. His daughter escapes but is chased. The Indians encounter Boone, which sets off a huge fight on the edge of a cliff. A burning arrow gets shot into the Indian camp. Boone gets tied to the stake and tortured. The burning arrow sets the Indian camp on fire, causing panic. Boone is rescued by his horse, and Boone has a knife fight in which he kills the Indian chief. [2]",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "085cc028cdb9536b20e9dc5e4aad962b",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "1",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "685eab0af6bfe530fafef47778504cdc",
|
||||
"text": "Wallace McCutcheon and Ediwin S. Porter",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "Wallace McCutcheon and Ediwin S. Porter",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "0f4e168c7c67f7a998388d2a33dceb6e",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "2",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "304a2118c16f40aaa72398eb7e4fe5b0",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "d5f3f6c86d306468913d972b6bb1c0d0",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "2",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "c8de7686990a194865fa9a4c1efa372d",
|
||||
"text": "Before heading out to a baseball game at a nearby ballpark, sports fan Mr. Brown drinks several highball cocktails. He arrives at the ballpark to watch the game, but has become so inebriated that the game appears to him in reverse, with the players running the bases backwards and the baseball flying back into the pitcher's hand. After the game is over, Mr. Brown is escorted home by one of his friends. When they arrive at Brown's house, they encounter his wife who becomes furious with the friend and proceeds to physically assault him, believing he is responsible for her husband's severe intoxication. [1]",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "7916777e484f4946555131c58773e30e",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "2",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "43335d03e7bf452e60c998719b54e7d1",
|
||||
"text": "Unknown",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "Unknown",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "979a3f2843093d5f62d0c2cb3727eac4",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "3",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "a41a129d5d7ec934283100f0bb3085c4",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "8bb9c3ff2f00393bf6f0597ed55b9317",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "3",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "813916a2a6f5f66a6050b8054581ea2f",
|
||||
"text": "The plot is that of a black woman going to the dentist for a toothache and being given laughing gas. On her way walking home, and in other situations, she can't stop laughing, and everyone she meets \"catches\" the laughter from her, including a vendor and police officers.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "73d963a07cf60de4b1d8f2d0fb5aede6",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "3",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "d3ea9ef7627b23a0e6945bdea5753f1a",
|
||||
"text": "Edwin Stanton Porter",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "Edwin Stanton Porter",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "7ca28fa6c594694e0b206df34db48229",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "4",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "f9ccdf830b75aa444d036fbd9b526a33",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "2274b89174df76e82968e0de3afdc2f3",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "4",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "4"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "b2bef8d7a844d06beb8fdccc2ef06fdb",
|
||||
"text": "On a beautiful summer day a father and mother take their daughter Dollie on an outing to the river. The mother refuses to buy a gypsy's wares. The gypsy tries to rob the mother, but the father drives him off. The gypsy returns to the camp and devises a plan. They return and kidnap Dollie while her parents are distracted. A rescue crew is organized, but the gypsy takes Dollie to his camp. They gag Dollie and hide her in a barrel before the rescue party gets to the camp. Once they leave the gypsies and escapes in their wagon. As the wagon crosses the river, the barrel falls into the water. Still sealed in the barrel, Dollie is swept downstream in dangerous currents. A boy who is fishing in the river finds the barrel, and Dollie is reunited safely with her parents.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "3bfec8785cdfa99c55d8f82e96e57662",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "4",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "4"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "14c090243f2e9712802e260347418a51",
|
||||
"text": "D. W. Griffith",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "D. W. Griffith",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "19aca3f9cdc071e1b1760ef49ab59d47",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "5",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "8c78d776a17a1727e0e67e890b5ad930",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "1ce5e9ab853ee032c13f1e375edf82ab",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "5",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "1121fc776e93563434565d547eec5dbb",
|
||||
"text": "A thug accosts a girl as she leaves her workplace but a man rescues her. The thug vows revenge and, with the help of two friends, attacks the girl and her rescuer again as they're going for a walk. This time they succeed in kidnapping the rescuer. He is bound and gagged and taken away in a cart. The girl runs home and gets help from several neighbors. They track the ruffians down to a cabin in the mountains where the gang has trapped their victim and set the cabin on fire. A thug and Rescuer fight on the roof of the house.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "0a598fa190609cd8d5b0d2528ed23192",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "5",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "7e2fb9fbe3680945c318d9232b1ccc5c",
|
||||
"text": "D. W. Griffith",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "D. W. Griffith",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "5"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "281a5d1302d9f19f207e848411b16f9b",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "6",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "be5a065c5ce087943e789d60ebf73a13",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "606dc3dcaf56bde4201ccafc8bc35402",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "6",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "325a7036f0b3c5a8b1ae81ccfb6df889",
|
||||
"text": "A young couple decides to elope after being caught in the midst of a romantic moment by the woman's angry father. They make plans to leave, but a thief discovers their plans and hides in their trunk and waits for the right moment to steal their belongings.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "b7fae7f03d1ce9691eafc072e8da6898",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "6",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "b726239d6c8d050cffcaeebf24fcf8c0",
|
||||
"text": "D.W. Griffith",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "D.W. Griffith",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "6"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "c164fff47319ea3a05f88984ea15d259",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "7",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "662547c6b9390676fcaf369519da5d79",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "13bf4a8330757e6380ef4c464089c9d4",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "7",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "7"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "212f300624af3204b3d0c6b0dbb05e61",
|
||||
"text": "A white girl (Florence Lawrence) rejects a proposal from an Indian brave (Charles Inslee) in this early one-reel Western melodrama. Despite the rejection, the Indian still comes to the girl's defense when she is abducted by his warring tribe. In her first year in films, Florence Lawrence was already the most popular among the Biograph Company's anonymous stock company players. By 1909, she was known the world over as \"The Biograph Girl.\"",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "e08d8ef4f05dbbc34e1af96e949da863",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "7",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "7"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "9d744e87184f15aa011f88966f13c622",
|
||||
"text": "D. W. Griffith",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "D. W. Griffith",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "7"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "4bbb3c39b2e7562a704a2e8113d85711",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "8",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "a500347d938ff5f3441fd2e2847721ce",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "c62cf98745985233f2e6cfe6ef5e8f62",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "8",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "8"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "0eaad18f63d8a4493e782546af8d84b4",
|
||||
"text": "No prints of the first American film adaptation of A Christmas Carol are known to exist,[1] but The Moving Picture World magazine provided a scene-by-scene description before the film's release. [2] Scrooge goes into his office and begins working. His nephew, along with three women who wish for Scrooge to donate enter. However, Scrooge dismisses them. On the night of Christmas Eve, his long-dead partner Jacob Marley comes as a ghost, warning him of a horrible fate if he does not change his ways. Scrooge meets three spirits that show Scrooge the real meaning of Christmas, along with his grave, the result of his parsimonious ways. The next morning, he wakes and realizes the error of his ways. Scrooge was then euphoric and generous for the rest of his life.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "6dc7feed6c772679a5e72ff9c6792750",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "8",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "8"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "bed253d34e1f7a33b4ddd242a77ffb91",
|
||||
"text": "Unknown",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "Unknown",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1,65 +1,65 @@
|
||||
[
|
||||
{
|
||||
"element_id": "12664dda068f54951fdc18492f588d94",
|
||||
"metadata": {
|
||||
"data_source": {
|
||||
"record_locator": {
|
||||
"document_id": "9",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"type": "Title",
|
||||
"element_id": "6c76a6263b7302899c540e3350cdbd2b",
|
||||
"text": "American",
|
||||
"type": "Title"
|
||||
},
|
||||
{
|
||||
"element_id": "b81e40ed8fe547adffc1970d75adebf1",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "9",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"index_name": "movies",
|
||||
"document_id": "9"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "NarrativeText",
|
||||
"element_id": "bd2078e66e6b773352f5aa1423ec5d11",
|
||||
"text": "The film opens in a town on the Mexican border. A poker game is going on in the local saloon. One of the players cheats and is shot dead by another of the players, a Mexican named Pedro. In the uproar that follows Pedro is wounded as he escapes from the saloon. The sheriff is called, who tracks Pedro to his home but Pedro kills the sherriff too. While Pedro hides, his wife Juanita, is arrested on suspicion of murdering the sheriff. Pedro rescues her from the town jail and the two head for the Mexican border. Caught by the posse before they reach the border, Juanita is killed and the film ends with Pedro being arrested and taken back to town.",
|
||||
"type": "NarrativeText"
|
||||
},
|
||||
{
|
||||
"element_id": "8796771b8f0da7f912bf4f38cc7a5e58",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"document_id": "9",
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies"
|
||||
},
|
||||
"version": 1
|
||||
},
|
||||
"filetype": "text/plain",
|
||||
"index_name": "movies",
|
||||
"document_id": "9"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Title",
|
||||
"element_id": "65acd8a8d5cd5c13cf6f0f6cc36343f7",
|
||||
"text": "D. W. Griffith",
|
||||
"metadata": {
|
||||
"languages": [
|
||||
"eng"
|
||||
]
|
||||
},
|
||||
"text": "D. W. Griffith",
|
||||
"type": "Title"
|
||||
],
|
||||
"filetype": "text/plain",
|
||||
"data_source": {
|
||||
"version": "1",
|
||||
"record_locator": {
|
||||
"hosts": [
|
||||
"http://localhost:9247"
|
||||
],
|
||||
"index_name": "movies",
|
||||
"document_id": "9"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -1 +1 @@
|
||||
__version__ = "0.14.10-dev1" # pragma: no cover
|
||||
__version__ = "0.14.10-dev2" # pragma: no cover
|
||||
|
||||
@ -14,7 +14,7 @@ from .fsspec.sftp import sftp_dest_cmd, sftp_src_cmd
|
||||
from .google_drive import google_drive_src_cmd
|
||||
from .local import local_dest_cmd, local_src_cmd
|
||||
from .onedrive import onedrive_drive_src_cmd
|
||||
from .opensearch import opensearch_dest_cmd
|
||||
from .opensearch import opensearch_dest_cmd, opensearch_src_cmd
|
||||
from .weaviate import weaviate_dest_cmd
|
||||
|
||||
src_cmds = [
|
||||
@ -26,6 +26,7 @@ src_cmds = [
|
||||
google_drive_src_cmd,
|
||||
local_src_cmd,
|
||||
onedrive_drive_src_cmd,
|
||||
opensearch_src_cmd,
|
||||
s3_src_cmd,
|
||||
sftp_src_cmd,
|
||||
]
|
||||
|
||||
@ -2,8 +2,10 @@ from dataclasses import dataclass
|
||||
|
||||
import click
|
||||
|
||||
from unstructured.ingest.v2.cli.base import DestCmd
|
||||
from unstructured.ingest.v2.cli.base import DestCmd, SrcCmd
|
||||
from unstructured.ingest.v2.cli.cmds.elasticsearch import (
|
||||
ElasticsearchCliDownloadConfig,
|
||||
ElasticsearchCliIndexerConfig,
|
||||
ElasticsearchCliUploadStagerConfig,
|
||||
ElasticsearchUploaderConfig,
|
||||
)
|
||||
@ -76,6 +78,13 @@ class OpenSearchCliConnectionConfig(CliConfig):
|
||||
return options
|
||||
|
||||
|
||||
opensearch_src_cmd = SrcCmd(
|
||||
cmd_name=CONNECTOR_TYPE,
|
||||
connection_config=OpenSearchCliConnectionConfig,
|
||||
indexer_config=ElasticsearchCliIndexerConfig,
|
||||
downloader_config=ElasticsearchCliDownloadConfig,
|
||||
)
|
||||
|
||||
opensearch_dest_cmd = DestCmd(
|
||||
cmd_name=CONNECTOR_TYPE,
|
||||
connection_config=OpenSearchCliConnectionConfig,
|
||||
|
||||
@ -130,9 +130,14 @@ class ElasticsearchIndexer(Indexer):
|
||||
self.client = self.connection_config.get_client()
|
||||
|
||||
@requires_dependencies(["elasticsearch"], extras="elasticsearch")
|
||||
def load_scan(self):
|
||||
from elasticsearch.helpers import scan
|
||||
|
||||
return scan
|
||||
|
||||
def _get_doc_ids(self) -> set[str]:
|
||||
"""Fetches all document ids in an index"""
|
||||
from elasticsearch.helpers import scan
|
||||
scan = self.load_scan()
|
||||
|
||||
scan_query: dict = {"stored_fields": [], "query": {"match_all": {}}}
|
||||
hits = scan(
|
||||
@ -248,10 +253,15 @@ class ElasticsearchDownloader(Downloader):
|
||||
raise NotImplementedError()
|
||||
|
||||
@requires_dependencies(["elasticsearch"], extras="elasticsearch")
|
||||
async def run_async(self, file_data: FileData, **kwargs: Any) -> download_responses:
|
||||
from elasticsearch import AsyncElasticsearch as AsyncElasticsearchClient
|
||||
def load_async(self):
|
||||
from elasticsearch import AsyncElasticsearch
|
||||
from elasticsearch.helpers import async_scan
|
||||
|
||||
return AsyncElasticsearch, async_scan
|
||||
|
||||
async def run_async(self, file_data: FileData, **kwargs: Any) -> download_responses:
|
||||
AsyncClient, async_scan = self.load_async()
|
||||
|
||||
index_name: str = file_data.additional_metadata["index_name"]
|
||||
ids: list[str] = file_data.additional_metadata["ids"]
|
||||
|
||||
@ -262,7 +272,7 @@ class ElasticsearchDownloader(Downloader):
|
||||
}
|
||||
|
||||
download_responses = []
|
||||
async with AsyncElasticsearchClient(**self.connection_config.get_client_kwargs()) as client:
|
||||
async with AsyncClient(**self.connection_config.get_client_kwargs()) as client:
|
||||
async for result in async_scan(
|
||||
client,
|
||||
query=scan_query,
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import dataclass, field
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from unstructured.ingest.enhanced_dataclass import EnhancedDataClassJsonMixin, enhanced_field
|
||||
from unstructured.ingest.error import DestinationConnectionError
|
||||
from unstructured.ingest.error import (
|
||||
DestinationConnectionError,
|
||||
)
|
||||
from unstructured.ingest.v2.interfaces import (
|
||||
AccessConfig,
|
||||
ConnectionConfig,
|
||||
@ -10,9 +12,15 @@ from unstructured.ingest.v2.interfaces import (
|
||||
from unstructured.ingest.v2.logger import logger
|
||||
from unstructured.ingest.v2.processes.connector_registry import (
|
||||
DestinationRegistryEntry,
|
||||
SourceRegistryEntry,
|
||||
add_destination_entry,
|
||||
add_source_entry,
|
||||
)
|
||||
from unstructured.ingest.v2.processes.connectors.elasticsearch import (
|
||||
ElasticsearchDownloader,
|
||||
ElasticsearchDownloaderConfig,
|
||||
ElasticsearchIndexer,
|
||||
ElasticsearchIndexerConfig,
|
||||
ElasticsearchUploader,
|
||||
ElasticsearchUploaderConfig,
|
||||
ElasticsearchUploadStager,
|
||||
@ -94,6 +102,31 @@ class OpenSearchConnectionConfig(ConnectionConfig):
|
||||
return OpenSearch(**self.get_client_kwargs())
|
||||
|
||||
|
||||
@dataclass
|
||||
class OpenSearchIndexer(ElasticsearchIndexer):
|
||||
connection_config: OpenSearchConnectionConfig
|
||||
client: "OpenSearch" = field(init=False)
|
||||
|
||||
@requires_dependencies(["opensearchpy"], extras="opensearch")
|
||||
def load_scan(self):
|
||||
from opensearchpy.helpers import scan
|
||||
|
||||
return scan
|
||||
|
||||
|
||||
@dataclass
|
||||
class OpenSearchDownloader(ElasticsearchDownloader):
|
||||
connection_config: OpenSearchConnectionConfig
|
||||
connector_type: str = CONNECTOR_TYPE
|
||||
|
||||
@requires_dependencies(["opensearchpy"], extras="opensearch")
|
||||
def load_async(self):
|
||||
from opensearchpy import AsyncOpenSearch
|
||||
from opensearchpy.helpers import async_scan
|
||||
|
||||
return AsyncOpenSearch, async_scan
|
||||
|
||||
|
||||
@dataclass
|
||||
class OpenSearchUploader(ElasticsearchUploader):
|
||||
connection_config: OpenSearchConnectionConfig
|
||||
@ -106,6 +139,16 @@ class OpenSearchUploader(ElasticsearchUploader):
|
||||
return parallel_bulk
|
||||
|
||||
|
||||
add_source_entry(
|
||||
source_type=CONNECTOR_TYPE,
|
||||
entry=SourceRegistryEntry(
|
||||
connection_config=OpenSearchConnectionConfig,
|
||||
indexer=OpenSearchIndexer,
|
||||
indexer_config=ElasticsearchIndexerConfig,
|
||||
downloader=OpenSearchDownloader,
|
||||
downloader_config=ElasticsearchDownloaderConfig,
|
||||
),
|
||||
)
|
||||
add_destination_entry(
|
||||
destination_type=CONNECTOR_TYPE,
|
||||
entry=DestinationRegistryEntry(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user