title: Suggestion on algorithm selection and implementation
body: <p>Good day,</p>
  
  <p>I'm working on the next problem and have minimum knowledge about machine learning (ML):</p>
  
  <ol>
  <li>Given the list of articles (A's, text format) and search string (SQ), select and order most relative articles (A's) to the search string (SQ).</li>
  <li>Optimize point #1 on case if new article (A) is added - i.e. so search will account new record and it will be taken into consideration next time.</li>
  </ol>
  
  <p>I've selected spark as the engine for ML calculations and found examples, which counts IDF models (<a href="https://spark.apache.org/docs/2.0.0/ml-features.html#tf-idf" rel="nofollow noreferrer">https://spark.apache.org/docs/2.0.0/ml-features.html#tf-idf</a>). This is smths that results in the end with feature-vector of frequencies of term in the article:</p>
  
  <p>(8,[0,1,4],[0.287... (8,[0,1,6],[0.287... (8,[1,3,4],[0.0,0...</p>
  
  <p>(sorry for truncated results)</p>
  
  <p>At this point I stuck. It looks like we might need to calculate similar vector for SQ and order somehow articles by closest. Not sure how to do that though.</p>
  
  <p>What would be right way forward? Can you please share/point to examples with implementation?</p>
  
  <p>Thank you in advance,</p>
  
  <p>Vitaliy</p>