Giter Site home page Giter Site logo

sdk-push-stream-python's People

Contributors

amoreaucoveo avatar jdevost avatar larosek avatar stevenspasbo avatar wnijmeijer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

sdk-push-stream-python's Issues

Calling Push.End doesn't clear the existing documents added through Push.Add

If your code is pushing content to different sources, after pushing the content in the first source and calling Push.End, the array isn't emptied properly, and all of the documents you previously pushed are still there, so that when you call Push.Start for your second source, all of your documents are still there, which means that your second source ends up with all the documents from your first source on top of the ones you actually want.

The following code snippet shows the issue in action:

from coveopush import CoveoPush
from coveopush import Document
from coveopush import CoveoPermissions
from coveopush import CoveoConstants

moviesettings ={
  "sourceId": "valid source id",
  "orgId": "valid org id",
  "apiKey": "valid api key"
}
directorsettings = {
  "sourceId": "valid source id",
  "orgId": "valid org id",
  "apiKey": "valid api key"
}
def push_movies():
    moviepush = CoveoPush.Push(moviesettings["sourceId"], moviesettings["orgId"], moviesettings["apiKey"])
    moviepush.Start(True, True)
    mydoc = Document('file://python.test.movie.txt')
    mydoc.Title = "Python Test"
    mydoc.SetData("This is a test I'm doing with the Python SDK")
    mydoc.FileExtension = ".txt"
    moviepush.Add(mydoc)
    moviepush.End(True, True)
    
def push_directors():
    directorpush = CoveoPush.Push(directorsettings["sourceId"], directorsettings["orgId"], directorsettings["apiKey"])
    directorpush.Start(True, True)
    mydoc = Document('file://python.test.director.txt')
    mydoc.Title = "Python Test"
    mydoc.SetData("This is a test I'm doing with the Python SDK")
    mydoc.FileExtension = ".txt"
    directorpush.Add(mydoc)
    directorpush.End(True, True)

push_movies()
push_directors()

missing on pypi

Can't find this package on Pypi, could you publish it please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.